* fix #15706 Underflow not detected when using dec on distinct ranges * fix #15846 first, jsgen even doesn't care of range in this op
This commit is contained in:
parent
8f7a013cc7
commit
c07807bedf
2 changed files with 7 additions and 1 deletions
|
|
@ -2269,7 +2269,7 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
|
|||
initLocExpr(p, e[1], a)
|
||||
initLocExpr(p, e[2], b)
|
||||
|
||||
let ranged = skipTypes(e[1].typ, {tyGenericInst, tyAlias, tySink, tyVar, tyLent})
|
||||
let ranged = skipTypes(e[1].typ, {tyGenericInst, tyAlias, tySink, tyVar, tyLent, tyDistinct})
|
||||
let res = binaryArithOverflowRaw(p, ranged, a, b,
|
||||
if underlying.kind == tyInt64: fun64[op] else: fun[op])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue