summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-07-25 22:09:08 +0200
committerAraq <rumpf_a@web.de>2012-07-25 22:09:08 +0200
commit840e5f34efa77afa4eed5233172c8a2c16c6d456 (patch)
tree54efb8ed33e61e2708b344d70c64bae76a4fca78 /compiler
parent04baf328f1a5214b3121ac84aa02c16683151556 (diff)
downloadNim-840e5f34efa77afa4eed5233172c8a2c16c6d456.tar.gz
no range checks for conversion to unsigned (but I may reconsider this)
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/ccgexprs.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 6c8510ff8..ed84a3126 100755
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1316,7 +1316,8 @@ proc genCast(p: BProc, e: PNode, d: var TLoc) =
 proc genRangeChck(p: BProc, n: PNode, d: var TLoc, magic: string) =
   var a: TLoc
   var dest = skipTypes(n.typ, abstractVar)
-  if optRangeCheck notin p.options:
+  # range checks for unsigned turned out to be buggy and annoying:
+  if optRangeCheck notin p.options or dest.kind in {tyUInt..tyUInt64}:
     InitLocExpr(p, n.sons[0], a)
     putIntoDest(p, d, n.typ, ropef("(($1) ($2))",
         [getTypeDesc(p.module, dest), rdCharLoc(a)]))