From fdc8dd41288c78052c21796b7e65e37cba71d316 Mon Sep 17 00:00:00 2001 From: Bung Date: Sun, 6 Nov 2022 18:47:35 +0800 Subject: Arc global (#20768) * temp * unsure * fix condition * port macro arc runable examples to one file * trigger doc ci * fix Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> --- compiler/injectdestructors.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler') diff --git a/compiler/injectdestructors.nim b/compiler/injectdestructors.nim index ad43e23fc..c245d8d6b 100644 --- a/compiler/injectdestructors.nim +++ b/compiler/injectdestructors.nim @@ -490,7 +490,7 @@ proc pVarTopLevel(v: PNode; c: var Con; s: var Scope; res: PNode) = res.add newTree(nkFastAsgn, v, genDefaultCall(v.typ, c, v.info)) elif sfThread notin v.sym.flags and sfCursor notin v.sym.flags: # do not destroy thread vars for now at all for consistency. - if sfGlobal in v.sym.flags and s.parent == nil: #XXX: Rethink this logic (see tarcmisc.test2) + if {sfGlobal, sfPure} <= v.sym.flags or sfGlobal in v.sym.flags and s.parent == nil: c.graph.globalDestructors.add c.genDestroy(v) else: s.final.add c.genDestroy(v) -- cgit 1.4.1-2-gfad0