summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2021-02-24 17:43:13 +0100
committerGitHub <noreply@github.com>2021-02-24 17:43:13 +0100
commite9a287fe120501de4c4f70fbf687e0ceb9b75ee9 (patch)
tree26ef957bfc04b7813b0c5cce3a66aaeb98036d6e /compiler
parent8942586fa6a0b044198a24dd5030dd5bcdb6cc2d (diff)
downloadNim-e9a287fe120501de4c4f70fbf687e0ceb9b75ee9.tar.gz
fixes #17170 (#17171)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgcalls.nim1
-rw-r--r--compiler/closureiters.nim3
2 files changed, 3 insertions, 1 deletions
diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim
index 7c2a21a36..64b883087 100644
--- a/compiler/ccgcalls.nim
+++ b/compiler/ccgcalls.nim
@@ -289,6 +289,7 @@ proc genArg(p: BProc, n: PNode, param: PSym; call: PNode, needsTmp = false): Rop
   else:
     initLocExprSingleUse(p, n, a)
     result = rdLoc(withTmpIfNeeded(p, a, needsTmp))
+  #assert result != nil
 
 proc genArgNoParam(p: BProc, n: PNode, needsTmp = false): Rope =
   var a: TLoc
diff --git a/compiler/closureiters.nim b/compiler/closureiters.nim
index 43dfc69ae..2270797ea 100644
--- a/compiler/closureiters.nim
+++ b/compiler/closureiters.nim
@@ -427,7 +427,8 @@ proc addExprAssgn(ctx: Ctx, output, input: PNode, sym: PSym) =
 
 proc convertExprBodyToAsgn(ctx: Ctx, exprBody: PNode, res: PSym): PNode =
   result = newNodeI(nkStmtList, exprBody.info)
-  ctx.addExprAssgn(result, exprBody, res)
+  if exprBody.typ != nil:
+    ctx.addExprAssgn(result, exprBody, res)
 
 proc newNotCall(g: ModuleGraph; e: PNode): PNode =
   result = newTree(nkCall, newSymNode(g.getSysMagic(e.info, "not", mNot), e.info), e)