Changes in src/AST/Convert.cpp [ae265b55:033ff37]
- File:
-
- 1 edited
-
src/AST/Convert.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
rae265b55 r033ff37 9 9 // Author : Thierry Delisle 10 10 // Created On : Thu May 09 15::37::05 2019 11 // Last Modified By : Andrew Beach12 // Last Modified On : Mon Jun 17 16:44:00201913 // Update Count : 1 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 25 22:21:46 2019 13 // Update Count : 13 14 14 // 15 15 … … 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 means616 // - 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 }621 610 return visitBaseExpr_skipResultType(src, tgt); 622 611 } … … 2124 2113 old->location, 2125 2114 GET_ACCEPT_1(member, DeclWithType), 2126 GET_ACCEPT_1(aggregate, Expr), 2127 ast::MemberExpr::NoOpConstructionChosen 2115 GET_ACCEPT_1(aggregate, Expr) 2128 2116 ) 2129 2117 ); … … 2688 2676 ); 2689 2677 } 2690 2691 virtual void visit( const AttrExpr * ) override final {2692 assertf( false, "AttrExpr deprecated in new AST." );2693 }2694 2678 }; 2695 2679
Note:
See TracChangeset
for help on using the changeset viewer.