Changes in src/AST/Convert.cpp [665f432:ae265b55]
- File:
-
- 1 edited
-
src/AST/Convert.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r665f432 rae265b55 9 9 // Author : Thierry Delisle 10 10 // Created On : Thu May 09 15::37::05 2019 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Jul 25 22:21:46201913 // Update Count : 1 311 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Jun 17 16:44:00 2019 13 // Update Count : 12 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 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 } … … 887 898 auto expr = visitBaseExpr( node, 888 899 new AsmExpr( 889 new std::string(node->inout),900 get<Expression>().accept1(node->inout), 890 901 get<Expression>().accept1(node->constraint), 891 902 get<Expression>().accept1(node->operand) … … 2113 2124 old->location, 2114 2125 GET_ACCEPT_1(member, DeclWithType), 2115 GET_ACCEPT_1(aggregate, Expr) 2126 GET_ACCEPT_1(aggregate, Expr), 2127 ast::MemberExpr::NoOpConstructionChosen 2116 2128 ) 2117 2129 ); … … 2258 2270 new ast::AsmExpr( 2259 2271 old->location, 2260 old->inout,2272 GET_ACCEPT_1(inout, Expr), 2261 2273 GET_ACCEPT_1(constraint, Expr), 2262 2274 GET_ACCEPT_1(operand, Expr) … … 2676 2688 ); 2677 2689 } 2690 2691 virtual void visit( const AttrExpr * ) override final { 2692 assertf( false, "AttrExpr deprecated in new AST." ); 2693 } 2678 2694 }; 2679 2695
Note:
See TracChangeset
for help on using the changeset viewer.