summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-01-27 09:49:45 +0100
committerAraq <rumpf_a@web.de>2017-01-27 09:49:45 +0100
commit68617adb91ecae00725523ae6bf2833fe6c07bd1 (patch)
tree6b93e61c8ec61527e81a47fa9d945b69d94bca4e /compiler
parent376f6efa80cbbfca80d632bfb56350f716cd759f (diff)
downloadNim-68617adb91ecae00725523ae6bf2833fe6c07bd1.tar.gz
fixes #5216
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semfold.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/semfold.nim b/compiler/semfold.nim
index e3469c602..05e398c9a 100644
--- a/compiler/semfold.nim
+++ b/compiler/semfold.nim
@@ -216,24 +216,24 @@ proc getIntervalType*(m: TMagic, n: PNode): PType =
     if b.kind in ordIntLit:
       let x = b.intVal|+|1
       if (x and -x) == x and x >= 0:
-        result = makeRange(a.typ, 0, b.intVal)
+        result = makeRange(n.typ, 0, b.intVal)
   of mModU:
     let a = n.sons[1]
     let b = n.sons[2]
     if b.kind in ordIntLit:
       if b.intVal >= 0:
-        result = makeRange(a.typ, 0, b.intVal-1)
+        result = makeRange(n.typ, 0, b.intVal-1)
       else:
-        result = makeRange(a.typ, b.intVal+1, 0)
+        result = makeRange(n.typ, b.intVal+1, 0)
   of mModI:
     # so ... if you ever wondered about modulo's signedness; this defines it:
     let a = n.sons[1]
     let b = n.sons[2]
     if b.kind in {nkIntLit..nkUInt64Lit}:
       if b.intVal >= 0:
-        result = makeRange(a.typ, -(b.intVal-1), b.intVal-1)
+        result = makeRange(n.typ, -(b.intVal-1), b.intVal-1)
       else:
-        result = makeRange(a.typ, b.intVal+1, -(b.intVal+1))
+        result = makeRange(n.typ, b.intVal+1, -(b.intVal+1))
   of mDivI, mDivU:
     binaryOp(`|div|`)
   of mMinI: