summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorLemonBoy <LemonBoy@users.noreply.github.com>2018-08-12 20:41:48 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-08-12 20:41:48 +0200
commitba7c874a7df6e96dee2d7647a3f554d7476d3ae6 (patch)
tree707a56f3ee9141f0de6976e494294d42438dce46 /compiler
parent089529c16aa45926eb64395e27b8e56b46f4aa92 (diff)
downloadNim-ba7c874a7df6e96dee2d7647a3f554d7476d3ae6.tar.gz
Mysterious fix for #8550 (#8561)
Replacing the `for` body with a nkEmpty node is not the right thing to
do.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/transf.nim7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/transf.nim b/compiler/transf.nim
index dae8d1ee6..c3bc29891 100644
--- a/compiler/transf.nim
+++ b/compiler/transf.nim
@@ -539,11 +539,8 @@ proc transformFor(c: PTransf, n: PNode): PTransNode =
   if call.kind notin nkCallKinds or call.sons[0].kind != nkSym or
       call.sons[0].typ.callConv == ccClosure:
     n.sons[length-1] = transformLoopBody(c, n.sons[length-1]).PNode
-    if not c.tooEarly:
-      n.sons[length-2] = transform(c, n.sons[length-2]).PNode
-      result[1] = lambdalifting.liftForLoop(c.graph, n, getCurrOwner(c)).PTransNode
-    else:
-      result[1] = newNode(nkEmpty).PTransNode
+    n.sons[length-2] = transform(c, n.sons[length-2]).PNode
+    result[1] = lambdalifting.liftForLoop(c.graph, n, getCurrOwner(c)).PTransNode
     discard c.breakSyms.pop
     return result