* fix #13902 distinct uint64 type corruption on 32-bit with borrow Co-authored-by: Timothee Cour <timothee.cour2+lightsail@gmail.com>
This commit is contained in:
parent
3036ec9c44
commit
95fd8ae93c
2 changed files with 13 additions and 1 deletions
|
|
@ -2156,7 +2156,7 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
|
|||
const opr: array[mInc..mDec, string] = ["+=", "-="]
|
||||
const fun64: array[mInc..mDec, string] = ["nimAddInt64", "nimSubInt64"]
|
||||
const fun: array[mInc..mDec, string] = ["nimAddInt","nimSubInt"]
|
||||
let underlying = skipTypes(e[1].typ, {tyGenericInst, tyAlias, tySink, tyVar, tyLent, tyRange})
|
||||
let underlying = skipTypes(e[1].typ, {tyGenericInst, tyAlias, tySink, tyVar, tyLent, tyRange, tyDistinct})
|
||||
if optOverflowCheck notin p.options or underlying.kind in {tyUInt..tyUInt64}:
|
||||
binaryStmt(p, e, d, opr[op])
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue