make parseopt compile with --newruntime
This commit is contained in:
parent
6617b8deee
commit
0518794291
1 changed files with 5 additions and 1 deletions
|
|
@ -648,8 +648,12 @@ proc transformFor(c: PTransf, n: PNode): PTransNode =
|
||||||
of paDirectMapping:
|
of paDirectMapping:
|
||||||
idNodeTablePut(newC.mapping, formal, arg)
|
idNodeTablePut(newC.mapping, formal, arg)
|
||||||
of paFastAsgn:
|
of paFastAsgn:
|
||||||
|
var t = formal.typ
|
||||||
|
if formal.ast != nil and formal.ast.typ.destructor != nil and t.destructor == nil:
|
||||||
|
t = formal.ast.typ # better use the type that actually has a destructor.
|
||||||
# generate a temporary and produce an assignment statement:
|
# generate a temporary and produce an assignment statement:
|
||||||
var temp = newTemp(c, formal.typ, formal.info)
|
var temp = newTemp(c, t, formal.info)
|
||||||
|
#temp.sym.flags.incl sfCursor
|
||||||
addVar(v, temp)
|
addVar(v, temp)
|
||||||
add(stmtList, newAsgnStmt(c, nkFastAsgn, temp, arg.PTransNode))
|
add(stmtList, newAsgnStmt(c, nkFastAsgn, temp, arg.PTransNode))
|
||||||
idNodeTablePut(newC.mapping, formal, temp)
|
idNodeTablePut(newC.mapping, formal, temp)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue