summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-06-24 21:11:24 +0200
committerAraq <rumpf_a@web.de>2015-06-25 02:08:58 +0200
commitce9fa80b92700a0ce36817a360d235ff024a3708 (patch)
treeba427d98f5d12e87d7e5553a088413d7574243de /compiler
parent2a1620490c43694bfdd433f0c940490d65b24a53 (diff)
downloadNim-ce9fa80b92700a0ce36817a360d235ff024a3708.tar.gz
fixes #2979
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 55fa7564c..10b5b1251 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1582,7 +1582,8 @@ proc genRangeChck(p: BProc, n: PNode, d: var TLoc, magic: string) =
   var a: TLoc
   var dest = skipTypes(n.typ, abstractVar)
   # range checks for unsigned turned out to be buggy and annoying:
-  if optRangeCheck notin p.options or dest.kind in {tyUInt..tyUInt64}:
+  if optRangeCheck notin p.options or dest.skipTypes({tyRange}).kind in
+                                             {tyUInt..tyUInt64}:
     initLocExpr(p, n.sons[0], a)
     putIntoDest(p, d, n.typ, "(($1) ($2))" %
         [getTypeDesc(p.module, dest), rdCharLoc(a)])