Fix #1392
This commit is contained in:
parent
821fe72ff5
commit
ed68286c59
1 changed files with 3 additions and 3 deletions
|
|
@ -1578,15 +1578,15 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
|
||||||
of mGetTypeInfo: genGetTypeInfo(p, e, d)
|
of mGetTypeInfo: genGetTypeInfo(p, e, d)
|
||||||
of mSwap: genSwap(p, e, d)
|
of mSwap: genSwap(p, e, d)
|
||||||
of mUnaryLt:
|
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)")
|
else: unaryExpr(p, e, d, "#subInt($1, 1)")
|
||||||
of mPred:
|
of mPred:
|
||||||
# XXX: range checking?
|
# 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)")
|
else: binaryExpr(p, e, d, "#subInt($1, $2)")
|
||||||
of mSucc:
|
of mSucc:
|
||||||
# XXX: range checking?
|
# 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)")
|
else: binaryExpr(p, e, d, "#addInt($1, $2)")
|
||||||
of mInc:
|
of mInc:
|
||||||
if not (optOverflowCheck in p.options):
|
if not (optOverflowCheck in p.options):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue