fixes thread vars of non-global visibility
This commit is contained in:
parent
646a569421
commit
259daf98cf
2 changed files with 3 additions and 2 deletions
|
|
@ -1976,7 +1976,8 @@ proc expr(p: BProc, n: PNode, d: var TLoc) =
|
||||||
of skEnumField:
|
of skEnumField:
|
||||||
putIntoDest(p, d, n.typ, rope(sym.position))
|
putIntoDest(p, d, n.typ, rope(sym.position))
|
||||||
of skVar, skForVar, skResult, skLet:
|
of skVar, skForVar, skResult, skLet:
|
||||||
if sfGlobal in sym.flags: genVarPrototype(p.module, sym)
|
if {sfGlobal, sfThread} * sym.flags != {}:
|
||||||
|
genVarPrototype(p.module, sym)
|
||||||
if sym.loc.r == nil or sym.loc.t == nil:
|
if sym.loc.r == nil or sym.loc.t == nil:
|
||||||
#echo "FAILED FOR PRCO ", p.prc.name.s
|
#echo "FAILED FOR PRCO ", p.prc.name.s
|
||||||
#echo renderTree(p.prc.ast, {renderIds})
|
#echo renderTree(p.prc.ast, {renderIds})
|
||||||
|
|
|
||||||
|
|
@ -788,7 +788,7 @@ proc genProc(m: BModule, prc: PSym) =
|
||||||
genProcAux(generatedHeader, prc)
|
genProcAux(generatedHeader, prc)
|
||||||
|
|
||||||
proc genVarPrototypeAux(m: BModule, sym: PSym) =
|
proc genVarPrototypeAux(m: BModule, sym: PSym) =
|
||||||
assert(sfGlobal in sym.flags)
|
#assert(sfGlobal in sym.flags)
|
||||||
useHeader(m, sym)
|
useHeader(m, sym)
|
||||||
fillLoc(sym.loc, locGlobalVar, sym.typ, mangleName(sym), OnHeap)
|
fillLoc(sym.loc, locGlobalVar, sym.typ, mangleName(sym), OnHeap)
|
||||||
if (lfNoDecl in sym.loc.flags) or containsOrIncl(m.declaredThings, sym.id):
|
if (lfNoDecl in sym.loc.flags) or containsOrIncl(m.declaredThings, sym.id):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue