check for int overflow
This commit is contained in:
parent
f14da64cde
commit
971df79a2d
1 changed files with 6 additions and 0 deletions
|
@ -1623,6 +1623,9 @@ proc fillShapes(
|
||||||
if pathWidth == 0:
|
if pathWidth == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if pathWidth < 0:
|
||||||
|
raise newException(PixieError, "Path int overflow detected")
|
||||||
|
|
||||||
var
|
var
|
||||||
coverages = newSeq[uint8](pathWidth)
|
coverages = newSeq[uint8](pathWidth)
|
||||||
hits = newSeq[(float32, int16)](partitioning.maxEntryCount)
|
hits = newSeq[(float32, int16)](partitioning.maxEntryCount)
|
||||||
|
@ -1689,6 +1692,9 @@ proc fillShapes(
|
||||||
if pathWidth == 0:
|
if pathWidth == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if pathWidth < 0:
|
||||||
|
raise newException(PixieError, "Path int overflow detected")
|
||||||
|
|
||||||
var
|
var
|
||||||
coverages = newSeq[uint8](pathWidth)
|
coverages = newSeq[uint8](pathWidth)
|
||||||
hits = newSeq[(float32, int16)](partitioning.maxEntryCount)
|
hits = newSeq[(float32, int16)](partitioning.maxEntryCount)
|
||||||
|
|
Loading…
Reference in a new issue