From 6914fb4b4faffeb4b20a666f7a65f7b7eae65cbb Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sun, 3 Nov 2019 07:55:55 +0100 Subject: [PATCH] fixes #12577 [backport] (#12584) --- compiler/lambdalifting.nim | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index 9f1d29ec6b2ce..ebd8843246405 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -261,8 +261,7 @@ proc liftIterSym*(g: ModuleGraph; n: PNode; owner: PSym): PNode = result.add(v) # add 'new' statement: result.add newCall(getSysSym(g, n.info, "internalNew"), env) - if g.config.selectedGC in {gcHooks, gcDestructors}: - createTypeBoundOpsLL(g, env.typ, n.info) + createTypeBoundOpsLL(g, env.typ, n.info) result.add makeClosure(g, iter, env, n.info) proc freshVarForClosureIter*(g: ModuleGraph; s, owner: PSym): PNode = @@ -613,8 +612,7 @@ proc rawClosureCreation(owner: PSym; localError(d.graph.config, env.info, "internal error: cannot create up reference") # we are not in the sem'check phase anymore! so pass 'nil' for the PContext # and hope for the best: - if d.graph.config.selectedGC in {gcHooks, gcDestructors}: - createTypeBoundOpsLL(d.graph, env.typ, owner.info) + createTypeBoundOpsLL(d.graph, env.typ, owner.info) proc finishClosureCreation(owner: PSym; d: DetectionPass; c: LiftingPass; info: TLineInfo; res: PNode) = @@ -642,8 +640,7 @@ proc closureCreationForIter(iter: PNode; addVar(vs, vnode) result.add(vs) result.add(newCall(getSysSym(d.graph, iter.info, "internalNew"), vnode)) - if d.graph.config.selectedGC in {gcHooks, gcDestructors}: - createTypeBoundOpsLL(d.graph, vnode.typ, iter.info) + createTypeBoundOpsLL(d.graph, vnode.typ, iter.info) let upField = lookupInRecord(v.typ.skipTypes({tyOwned, tyRef, tyPtr}).n, getIdent(d.graph.cache, upName)) if upField != nil: @@ -928,8 +925,7 @@ proc liftForLoop*(g: ModuleGraph; body: PNode; owner: PSym): PNode = result.add(v) # add 'new' statement: result.add(newCall(getSysSym(g, env.info, "internalNew"), env.newSymNode)) - if g.config.selectedGC in {gcHooks, gcDestructors}: - createTypeBoundOpsLL(g, env.typ, body.info) + createTypeBoundOpsLL(g, env.typ, body.info) elif op.kind == nkStmtListExpr: let closure = op.lastSon