no range checks for conversion to unsigned (but I may reconsider this)
This commit is contained in:
parent
04baf328f1
commit
840e5f34ef
1 changed files with 2 additions and 1 deletions
|
|
@ -1316,7 +1316,8 @@ proc genCast(p: BProc, e: PNode, d: var TLoc) =
|
||||||
proc genRangeChck(p: BProc, n: PNode, d: var TLoc, magic: string) =
|
proc genRangeChck(p: BProc, n: PNode, d: var TLoc, magic: string) =
|
||||||
var a: TLoc
|
var a: TLoc
|
||||||
var dest = skipTypes(n.typ, abstractVar)
|
var dest = skipTypes(n.typ, abstractVar)
|
||||||
if optRangeCheck notin p.options:
|
# range checks for unsigned turned out to be buggy and annoying:
|
||||||
|
if optRangeCheck notin p.options or dest.kind in {tyUInt..tyUInt64}:
|
||||||
InitLocExpr(p, n.sons[0], a)
|
InitLocExpr(p, n.sons[0], a)
|
||||||
putIntoDest(p, d, n.typ, ropef("(($1) ($2))",
|
putIntoDest(p, d, n.typ, ropef("(($1) ($2))",
|
||||||
[getTypeDesc(p.module, dest), rdCharLoc(a)]))
|
[getTypeDesc(p.module, dest), rdCharLoc(a)]))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue