Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r665f432 rae265b55  
    99// Author           : Thierry Delisle
    1010// Created On       : Thu May 09 15::37::05 2019
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 25 22:21:46 2019
    13 // Update Count     : 13
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Mon Jun 17 16:44:00 2019
     13// Update Count     : 12
    1414//
    1515
     
    608608
    609609                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                }
    610621                return visitBaseExpr_skipResultType(src, tgt);
    611622        }
     
    887898                auto expr = visitBaseExpr( node,
    888899                        new AsmExpr(
    889                                 new std::string(node->inout),
     900                                get<Expression>().accept1(node->inout),
    890901                                get<Expression>().accept1(node->constraint),
    891902                                get<Expression>().accept1(node->operand)
     
    21132124                                old->location,
    21142125                                GET_ACCEPT_1(member, DeclWithType),
    2115                                 GET_ACCEPT_1(aggregate, Expr)
     2126                                GET_ACCEPT_1(aggregate, Expr),
     2127                                ast::MemberExpr::NoOpConstructionChosen
    21162128                        )
    21172129                );
     
    22582270                        new ast::AsmExpr(
    22592271                                old->location,
    2260                                 old->inout,
     2272                                GET_ACCEPT_1(inout, Expr),
    22612273                                GET_ACCEPT_1(constraint, Expr),
    22622274                                GET_ACCEPT_1(operand, Expr)
     
    26762688                );
    26772689        }
     2690
     2691        virtual void visit( const AttrExpr * ) override final {
     2692                assertf( false, "AttrExpr deprecated in new AST." );
     2693        }
    26782694};
    26792695
Note: See TracChangeset for help on using the changeset viewer.