summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-05-27 22:38:06 +0200
committerAraq <rumpf_a@web.de>2019-05-27 22:38:06 +0200
commit84ca1f3bf3d0095034973fae8c36999f8778c451 (patch)
treec3d4bbd37f36f345e821dbfae569cbb62f173637 /lib/system
parentc644bf399fdfb21eebc6018f2edf487ef6345dd1 (diff)
downloadNim-84ca1f3bf3d0095034973fae8c36999f8778c451.tar.gz
hotfix for 32bit unsigned 'range' checking; incomplete, unknown why some operations produce range checks
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/chcks.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/system/chcks.nim b/lib/system/chcks.nim
index d108e09f1..303a8945a 100644
--- a/lib/system/chcks.nim
+++ b/lib/system/chcks.nim
@@ -46,6 +46,12 @@ proc chckRange64(i, a, b: int64): int64 {.compilerproc.} =
   else:
     raiseRangeError(i)
 
+proc chckRangeU(i, a, b: uint64): uint64 {.compilerproc.} =
+  if i >= a and i <= b:
+    return i
+  else:
+    sysFatal(RangeError, "value out of range")
+
 proc chckRangeF(x, a, b: float): float =
   if x >= a and x <= b:
     return x