summary refs log tree commit diff stats
path: root/compiler/injectdestructors.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-04-10 13:53:47 +0200
committerAraq <rumpf_a@web.de>2019-04-10 13:53:47 +0200
commita34ce2714a11595808cd8421636a89f44c1feb7b (patch)
tree4b8da00341c33ddb77fb76b14a705497ed7bb75b /compiler/injectdestructors.nim
parent28b4db447041207bcc4333c1d6bfa8031e79ebf3 (diff)
downloadNim-a34ce2714a11595808cd8421636a89f44c1feb7b.tar.gz
newruntime: fixes another bug
Diffstat (limited to 'compiler/injectdestructors.nim')
-rw-r--r--compiler/injectdestructors.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/injectdestructors.nim b/compiler/injectdestructors.nim
index 71ba61fb6..6ec8193d1 100644
--- a/compiler/injectdestructors.nim
+++ b/compiler/injectdestructors.nim
@@ -425,6 +425,9 @@ proc sinkParamIsLastReadCheck(c: var Con, s: PNode) =
 proc passCopyToSink(n: PNode; c: var Con): PNode =
   result = newNodeIT(nkStmtListExpr, n.info, n.typ)
   let tmp = getTemp(c, n.typ, n.info)
+  # XXX This is only required if we are in a loop. Since we move temporaries
+  # out of loops we need to mark it as 'wasMoved'.
+  result.add genWasMoved(tmp, c)
   if hasDestructor(n.typ):
     var m = genCopy(c, n.typ, tmp, n)
     m.add p(n, c)