parent
1a2bda45ec
commit
bb8b1c3b57
2 changed files with 12 additions and 3 deletions
|
|
@ -1989,6 +1989,7 @@ proc expr(p: BProc, n: PNode, d: var TLoc) =
|
||||||
if sfGlobal in sym.flags: genVarPrototype(p.module, sym)
|
if sfGlobal in 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})
|
||||||
internalError n.info, "expr: var not init " & sym.name.s & "_" & $sym.id
|
internalError n.info, "expr: var not init " & sym.name.s & "_" & $sym.id
|
||||||
if sfThread in sym.flags:
|
if sfThread in sym.flags:
|
||||||
accessThreadLocalVar(p, sym)
|
accessThreadLocalVar(p, sym)
|
||||||
|
|
|
||||||
|
|
@ -161,8 +161,9 @@ proc transformVarSection(c: PTransf, v: PNode): PTransNode =
|
||||||
newVar.ast = defs[2].PNode
|
newVar.ast = defs[2].PNode
|
||||||
result[i] = defs
|
result[i] = defs
|
||||||
else:
|
else:
|
||||||
# has been transformed into 'param.x' for closure iterators, so keep it:
|
# has been transformed into 'param.x' for closure iterators, so just
|
||||||
result[i] = PTransNode(it)
|
# transform it:
|
||||||
|
result[i] = transform(c, it)
|
||||||
else:
|
else:
|
||||||
if it.kind != nkVarTuple:
|
if it.kind != nkVarTuple:
|
||||||
internalError(it.info, "transformVarSection: not nkVarTuple")
|
internalError(it.info, "transformVarSection: not nkVarTuple")
|
||||||
|
|
@ -820,7 +821,14 @@ proc transform(c: PTransf, n: PNode): PTransNode =
|
||||||
# XXX comment handling really sucks:
|
# XXX comment handling really sucks:
|
||||||
if importantComments():
|
if importantComments():
|
||||||
PNode(result).comment = n.comment
|
PNode(result).comment = n.comment
|
||||||
of nkClosure: return PTransNode(n)
|
of nkClosure:
|
||||||
|
# it can happen that for-loop-inlining produced a fresh
|
||||||
|
# set of variables, including some computed environment
|
||||||
|
# (bug #2604). We need to patch this environment here too:
|
||||||
|
let a = n[1]
|
||||||
|
if a.kind == nkSym:
|
||||||
|
n.sons[1] = transformSymAux(c, a)
|
||||||
|
return PTransNode(n)
|
||||||
else:
|
else:
|
||||||
result = transformSons(c, n)
|
result = transformSons(c, n)
|
||||||
when false:
|
when false:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue