summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2014-07-23 00:06:30 +0200
committerAndreas Rumpf <rumpf_a@web.de>2014-07-23 00:06:30 +0200
commitdcf1425eb996db5d39a23c0360573f1addd4a850 (patch)
tree8276c8e9fa76fe0fa093541040d992de81eeeb22 /compiler
parent821fe72ff55866737c5b1d9f356b8d142f8836c3 (diff)
parented68286c592b0f2ff0d27496c740b9e9f6b761a7 (diff)
downloadNim-dcf1425eb996db5d39a23c0360573f1addd4a850.tar.gz
Merge pull request #1399 from flaviut/patch-1
Fix #1392
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 95167e157..691feeb47 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1578,15 +1578,15 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
   of mGetTypeInfo: genGetTypeInfo(p, e, d)
   of mSwap: genSwap(p, e, d)
   of mUnaryLt: 
-    if not (optOverflowCheck in p.options): unaryExpr(p, e, d, "$1 - 1")
+    if not (optOverflowCheck in p.options): unaryExpr(p, e, d, "($1 - 1)")
     else: unaryExpr(p, e, d, "#subInt($1, 1)")
   of mPred:
     # XXX: range checking?
-    if not (optOverflowCheck in p.options): binaryExpr(p, e, d, "$1 - $2")
+    if not (optOverflowCheck in p.options): binaryExpr(p, e, d, "($1 - $2)")
     else: binaryExpr(p, e, d, "#subInt($1, $2)")
   of mSucc:
     # XXX: range checking?
-    if not (optOverflowCheck in p.options): binaryExpr(p, e, d, "$1 + $2")
+    if not (optOverflowCheck in p.options): binaryExpr(p, e, d, "($1 + $2)")
     else: binaryExpr(p, e, d, "#addInt($1, $2)")
   of mInc:
     if not (optOverflowCheck in p.options):