summary refs log tree commit diff stats
path: root/lib/system/mm/none.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system/mm/none.nim')
-rw-r--r--lib/system/mm/none.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/system/mm/none.nim b/lib/system/mm/none.nim
index 3572b062c..0079daac3 100644
--- a/lib/system/mm/none.nim
+++ b/lib/system/mm/none.nim
@@ -19,10 +19,12 @@ proc newObj(typ: PNimType, size: int): pointer {.compilerproc.} =
 proc newObjNoInit(typ: PNimType, size: int): pointer =
   result = alloc(size)
 
+{.push overflowChecks: on.}
 proc newSeq(typ: PNimType, len: int): pointer {.compilerproc.} =
-  result = newObj(typ, addInt(mulInt(len, typ.base.size), GenericSeqSize))
+  result = newObj(typ, len * typ.base.size + GenericSeqSize)
   cast[PGenericSeq](result).len = len
   cast[PGenericSeq](result).reserved = len
+{.pop.}
 
 proc growObj(old: pointer, newsize: int): pointer =
   result = realloc(old, newsize)