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>
This commit is contained in:
parent
93b085a57a
commit
fdc8dd4128
3 changed files with 48 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue