From 95fd8ae93ce8732eb5a979d4cd63e0350594318d Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 8 Apr 2020 00:56:16 -0700 Subject: fix #13902 distinct uint64 type corruption on 32-bit with borrow (#13907) [backport:1.2] * fix #13902 distinct uint64 type corruption on 32-bit with borrow Co-authored-by: Timothee Cour --- compiler/ccgexprs.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/ccgexprs.nim') diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index fcedcf001..d8f5d016b 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -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: -- cgit 1.4.1-2-gfad0