From 84ca1f3bf3d0095034973fae8c36999f8778c451 Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 27 May 2019 22:38:06 +0200 Subject: hotfix for 32bit unsigned 'range' checking; incomplete, unknown why some operations produce range checks --- lib/system/chcks.nim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/system') 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 -- cgit 1.4.1-2-gfad0