Revert "fix arc global variable issues" (#20764)
* Revert "fix arc global variable issues (#20759)"
This reverts commit a3d32a4176.
* trigger documentation builds
This commit is contained in:
parent
10e7f18d01
commit
afd4e22f76
3 changed files with 4 additions and 6 deletions
1
.github/workflows/ci_docs.yml
vendored
1
.github/workflows/ci_docs.yml
vendored
|
|
@ -14,6 +14,7 @@ on:
|
||||||
- 'tools/kochdocs.nim'
|
- 'tools/kochdocs.nim'
|
||||||
- '.github/workflows/ci_docs.yml'
|
- '.github/workflows/ci_docs.yml'
|
||||||
- 'koch.nim'
|
- 'koch.nim'
|
||||||
|
|
||||||
pull_request:
|
pull_request:
|
||||||
# Run only on changes on these files.
|
# Run only on changes on these files.
|
||||||
paths:
|
paths:
|
||||||
|
|
|
||||||
|
|
@ -490,11 +490,8 @@ proc pVarTopLevel(v: PNode; c: var Con; s: var Scope; res: PNode) =
|
||||||
res.add newTree(nkFastAsgn, v, genDefaultCall(v.typ, c, v.info))
|
res.add newTree(nkFastAsgn, v, genDefaultCall(v.typ, c, v.info))
|
||||||
elif sfThread notin v.sym.flags and sfCursor notin v.sym.flags:
|
elif sfThread notin v.sym.flags and sfCursor notin v.sym.flags:
|
||||||
# do not destroy thread vars for now at all for consistency.
|
# do not destroy thread vars for now at all for consistency.
|
||||||
if sfGlobal in v.sym.flags: #XXX: Rethink this logic (see tarcmisc.test2)
|
if sfGlobal in v.sym.flags and s.parent == nil: #XXX: Rethink this logic (see tarcmisc.test2)
|
||||||
if c.inLoop > 0:
|
c.graph.globalDestructors.add c.genDestroy(v)
|
||||||
s.final.add c.genDestroy(v)
|
|
||||||
else:
|
|
||||||
c.graph.globalDestructors.add c.genDestroy(v)
|
|
||||||
else:
|
else:
|
||||||
s.final.add c.genDestroy(v)
|
s.final.add c.genDestroy(v)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ proc test(count: int) =
|
||||||
test(3)
|
test(3)
|
||||||
|
|
||||||
proc test2(count: int) =
|
proc test2(count: int) =
|
||||||
block: #XXX: Fails with block currently
|
#block: #XXX: Fails with block currently
|
||||||
var v {.global.} = newVariable(20)
|
var v {.global.} = newVariable(20)
|
||||||
|
|
||||||
var count = count - 1
|
var count = count - 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue