l-values are preserved modulo type distinction

This commit is contained in:
Araq 2011-09-24 13:15:11 +02:00
commit 033e3dfc50
4 changed files with 14 additions and 7 deletions

View file

@ -1395,7 +1395,11 @@ proc genRangeChck(p: BProc, n: PNode, d: var TLoc, magic: string) =
toRope(magic)]))
proc genConv(p: BProc, e: PNode, d: var TLoc) =
genCast(p, e, d)
if equalOrDistinctOf(e.typ, e.sons[1].typ) or
equalOrDistinctOf(e.sons[1].typ, e.typ):
expr(p, e.sons[1], d)
else:
genCast(p, e, d)
proc convStrToCStr(p: BProc, n: PNode, d: var TLoc) =
var a: TLoc