Changeset f6cc734e for src/AST/Convert.cpp
- Timestamp:
- Jul 22, 2019, 4:13:38 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:
- 4eb43fa
- Parents:
- 99da267
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r99da267 rf6cc734e 607 607 608 608 tgt->result = get<Type>().accept1(src->result); 609 // Unconditionally use a clone of the result type. 610 // We know this will leak some objects: much of the immediate conversion result. 611 // In some cases, using the conversion result directly gives unintended object sharing. 612 // A parameter (ObjectDecl, a child of a FunctionType) is shared by the weak-ref cache. 613 // But tgt->result must be fully owned privately by tgt. 614 // Applying these conservative copies here means 615 // - weak references point at the declaration's copy, not these expr.result copies (good) 616 // - we copy more objects than really needed (bad, tolerated) 617 if (tgt->result) { 618 tgt->result = tgt->result->clone(); 619 } 609 620 return visitBaseExpr_skipResultType(src, tgt); 610 621 }
Note: See TracChangeset
for help on using the changeset viewer.