check for int overflow

This commit is contained in:
Ryan Oldenburg 2022-03-29 18:13:36 -05:00
parent f14da64cde
commit 971df79a2d

View file

@ -1623,6 +1623,9 @@ proc fillShapes(
if pathWidth == 0:
return
if pathWidth < 0:
raise newException(PixieError, "Path int overflow detected")
var
coverages = newSeq[uint8](pathWidth)
hits = newSeq[(float32, int16)](partitioning.maxEntryCount)
@ -1689,6 +1692,9 @@ proc fillShapes(
if pathWidth == 0:
return
if pathWidth < 0:
raise newException(PixieError, "Path int overflow detected")
var
coverages = newSeq[uint8](pathWidth)
hits = newSeq[(float32, int16)](partitioning.maxEntryCount)