Changes in src/Tuples/Explode.h [75308bcc:490ff5c3]
- File:
-
- 1 edited
-
src/Tuples/Explode.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Tuples/Explode.h
r75308bcc r490ff5c3 27 27 namespace SymTab { 28 28 class Indexer; 29 } // namespace SymTab f29 } // namespace SymTab 30 30 31 31 namespace Tuples { … … 67 67 for ( ResolvExpr::Alternative & alt : alts ) { 68 68 // distribute reference cast over all components 69 append( std::forward<Output>(out), distributeReference( alt. expr),69 append( std::forward<Output>(out), distributeReference( alt.release_expr() ), 70 70 alt.env, alt.cost, alt.cvtCost ); 71 71 } … … 84 84 // tuple type, but not tuple expr - recursively index into its components. 85 85 // if expr type is reference, convert to value type 86 Expression * arg = expr ;86 Expression * arg = expr->clone(); 87 87 if ( Tuples::maybeImpureIgnoreUnique( arg ) ) { 88 88 // expressions which may contain side effects require a single unique instance of the expression. … … 94 94 } 95 95 for ( unsigned int i = 0; i < tupleType->size(); i++ ) { 96 TupleIndexExpr * idx = new TupleIndexExpr( arg , i );96 TupleIndexExpr * idx = new TupleIndexExpr( arg->clone(), i ); 97 97 explodeUnique( idx, alt, indexer, std::forward<Output>(out), isTupleAssign ); 98 delete idx; 98 99 } 100 delete arg; 99 101 } 100 102 } else { 101 // atomic (non-tuple) type - output the expression in a new alternative102 append( std::forward<Output>(out), expr , alt.env, alt.cost, alt.cvtCost );103 // atomic (non-tuple) type - output a clone of the expression in a new alternative 104 append( std::forward<Output>(out), expr->clone(), alt.env, alt.cost, alt.cvtCost ); 103 105 } 104 106 }
Note:
See TracChangeset
for help on using the changeset viewer.