fixes a closure iterator memory leaks, progress on #15076
This commit is contained in:
parent
4c43915b59
commit
318f0992ea
2 changed files with 37 additions and 1 deletions
|
|
@ -787,7 +787,7 @@ proc p(n: PNode; c: var Con; s: var Scope; mode: ProcessMode): PNode =
|
|||
if ri.kind == nkEmpty and c.inLoop > 0:
|
||||
ri = genDefaultCall(v.typ, c, v.info)
|
||||
if ri.kind != nkEmpty:
|
||||
result.add moveOrCopy(v, ri, c, s, isDecl = true)
|
||||
result.add moveOrCopy(v, ri, c, s, isDecl = false)
|
||||
else: # keep the var but transform 'ri':
|
||||
var v = copyNode(n)
|
||||
var itCopy = copyNode(it)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue