Destructors: more moves for tuples (#9808)
This commit is contained in:
parent
cc0364e72f
commit
5b98afb8a8
4 changed files with 13 additions and 4 deletions
|
|
@ -458,6 +458,11 @@ proc moveOrCopy(dest, ri: PNode; c: var Con): PNode =
|
|||
else:
|
||||
result = genCopy(c, dest.typ, dest, ri)
|
||||
result.add p(ri, c)
|
||||
of nkStmtListExpr:
|
||||
result = newNodeI(nkStmtList, ri.info)
|
||||
for i in 0..ri.len-2:
|
||||
result.add p(ri[i], c)
|
||||
result.add moveOrCopy(dest, ri[^1], c)
|
||||
of nkObjConstr:
|
||||
result = genSink(c, dest.typ, dest, ri)
|
||||
let ri2 = copyTree(ri)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue