parent
92e525d2a6
commit
a3d32a4176
2 changed files with 6 additions and 3 deletions
|
|
@ -490,7 +490,10 @@ 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 in v.sym.flags: #XXX: Rethink this logic (see tarcmisc.test2)
|
||||
if c.inLoop > 0:
|
||||
s.final.add c.genDestroy(v)
|
||||
else:
|
||||
c.graph.globalDestructors.add c.genDestroy(v)
|
||||
else:
|
||||
s.final.add c.genDestroy(v)
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ proc test(count: int) =
|
|||
test(3)
|
||||
|
||||
proc test2(count: int) =
|
||||
#block: #XXX: Fails with block currently
|
||||
block: #XXX: Fails with block currently
|
||||
var v {.global.} = newVariable(20)
|
||||
|
||||
var count = count - 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue