summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-04-05 12:36:06 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-04-05 12:38:30 +0200
commit3e3a8bd4cddf3bc188153a82c5f53b7921bb6ae9 (patch)
tree8b96464b6c35d221342dc0482d5ffd5f1242300a
parentf309e4ff540fd1f16d1713ffc49dbc4528907dc1 (diff)
downloadNim-3e3a8bd4cddf3bc188153a82c5f53b7921bb6ae9.tar.gz
newruntime: codegen fix
-rw-r--r--compiler/ccgexprs.nim9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index ece452602..9d1731708 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1930,12 +1930,11 @@ proc genMove(p: BProc; n: PNode; d: var TLoc) =
   initLocExpr(p, n[1].skipAddr, a)
   if n.len == 4:
     # generated by liftdestructors:
-    var src, destroyCall: TLoc
+    var src: TLoc
     initLocExpr(p, n[2], src)
-    initLocExpr(p, n[3], destroyCall)
-    linefmt(p, cpsStmts, "if ($1.len && $1.p != $2.p) { $3; }$n" &
-      "$1.len = $2.len; $1.p = $2.p;$n",
-      [rdLoc(a), rdLoc(src), rdLoc(destroyCall)])
+    linefmt(p, cpsStmts, "if ($1.len && $1.p != $2.p) {", [rdLoc(a), rdLoc(src)])
+    genStmts(p, n[3])
+    linefmt(p, cpsStmts, "}$n$1.len = $2.len; $1.p = $2.p;$n", [rdLoc(a), rdLoc(src)])
   else:
     if d.k == locNone: getTemp(p, n.typ, d)
     genAssignment(p, d, a, {})