Changeset 4eb43fa for src/AST/Convert.cpp
- Timestamp:
- Jul 22, 2019, 4:23:33 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 96ac72c
- Parents:
- f53acdf8 (diff), f6cc734e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
rf53acdf8 r4eb43fa 608 608 609 609 tgt->result = get<Type>().accept1(src->result); 610 // Unconditionally use a clone of the result type. 611 // We know this will leak some objects: much of the immediate conversion result. 612 // In some cases, using the conversion result directly gives unintended object sharing. 613 // A parameter (ObjectDecl, a child of a FunctionType) is shared by the weak-ref cache. 614 // But tgt->result must be fully owned privately by tgt. 615 // Applying these conservative copies here means 616 // - weak references point at the declaration's copy, not these expr.result copies (good) 617 // - we copy more objects than really needed (bad, tolerated) 618 if (tgt->result) { 619 tgt->result = tgt->result->clone(); 620 } 610 621 return visitBaseExpr_skipResultType(src, tgt); 611 622 }
Note: See TracChangeset
for help on using the changeset viewer.