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
ref='/ahoang/Nim/blame/changelog.md?h=devel&id=c17f6c7837d9fc2268543e34c03f95e50229650d'>^
d52a1061b ^

b14cc1e3b ^


d52a1061b ^

d7a896f19 ^


90c1b94fb ^

560d87f5f ^
90c1b94fb ^
9565da11e ^
089506498 ^

4e4d466d0 ^

a9ba02e8c ^
4e4d466d0 ^



a9ba02e8c ^
4e4d466d0 ^
742f43e57 ^



a9ba02e8c ^
742f43e57 ^
a9ba02e8c ^
742f43e57 ^


a9ba02e8c ^
742f43e57 ^
a9ba02e8c ^
136dbd3c6 ^




a9ba02e8c ^
136dbd3c6 ^



a9ba02e8c ^
5e66a7ce5 ^



a4d40d137 ^


661ce8b8c ^

908a25a2c ^

55cdaaef6 ^
844e12306 ^

0594a3a70 ^


908a25a2c ^
0594a3a70 ^






8d1a5dc8e ^



5d2e86ea1 ^


ca9f3b47d ^
5d2e86ea1 ^



ca9f3b47d ^
b74a5148a ^

5196cc3a5 ^
45821ea2a ^


33814cf63 ^





255902f9a ^
17becb8d3 ^




6df6ec27e ^


196977f62 ^


ca9f3b47d ^

8db5b32ff ^

e0591d494 ^

26198e4ee ^


a9ba02e8c ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146