newruntime: codegen fix
This commit is contained in:
parent
f309e4ff54
commit
3e3a8bd4cd
1 changed files with 4 additions and 5 deletions
|
|
@ -1930,12 +1930,11 @@ proc genMove(p: BProc; n: PNode; d: var TLoc) =
|
||||||
initLocExpr(p, n[1].skipAddr, a)
|
initLocExpr(p, n[1].skipAddr, a)
|
||||||
if n.len == 4:
|
if n.len == 4:
|
||||||
# generated by liftdestructors:
|
# generated by liftdestructors:
|
||||||
var src, destroyCall: TLoc
|
var src: TLoc
|
||||||
initLocExpr(p, n[2], src)
|
initLocExpr(p, n[2], src)
|
||||||
initLocExpr(p, n[3], destroyCall)
|
linefmt(p, cpsStmts, "if ($1.len && $1.p != $2.p) {", [rdLoc(a), rdLoc(src)])
|
||||||
linefmt(p, cpsStmts, "if ($1.len && $1.p != $2.p) { $3; }$n" &
|
genStmts(p, n[3])
|
||||||
"$1.len = $2.len; $1.p = $2.p;$n",
|
linefmt(p, cpsStmts, "}$n$1.len = $2.len; $1.p = $2.p;$n", [rdLoc(a), rdLoc(src)])
|
||||||
[rdLoc(a), rdLoc(src), rdLoc(destroyCall)])
|
|
||||||
else:
|
else:
|
||||||
if d.k == locNone: getTemp(p, n.typ, d)
|
if d.k == locNone: getTemp(p, n.typ, d)
|
||||||
genAssignment(p, d, a, {})
|
genAssignment(p, d, a, {})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue