compiler generates volatile temps to keep C compiler from optimizing away stack roots

This commit is contained in:
Araq 2011-12-12 01:40:23 +01:00
commit 94358e03e9
5 changed files with 85 additions and 28 deletions

View file

@ -252,6 +252,7 @@ proc genCall(p: BProc, e: PNode, d: var TLoc) =
genNamedParamCall(p, e, d)
else:
genPrefixCall(p, nil, e, d)
if d.s == onStack and containsGarbageCollectedRef(d.t): keepAlive(p, d)
proc genAsgnCall(p: BProc, le, ri: PNode, d: var TLoc) =
if ri.sons[0].kind == nkSym and sfInfixCall in ri.sons[0].sym.flags and
@ -261,4 +262,5 @@ proc genAsgnCall(p: BProc, le, ri: PNode, d: var TLoc) =
genNamedParamCall(p, ri, d)
else:
genPrefixCall(p, le, ri, d)
if d.s == onStack and containsGarbageCollectedRef(d.t): keepAlive(p, d)