Ignore:
Timestamp:
Aug 19, 2020, 2:09:04 PM (16 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
03a4c73
Parents:
133a161 (diff), 13d33a7 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Unify.cc

    r133a161 r8e9d567  
    791791                        for ( const ast::DeclWithType * d : src ) {
    792792                                ast::Pass<TtypeExpander_new> expander{ env };
    793                                 d = d->accept( expander );
    794                                 auto types = flatten( d->get_type() );
     793                                // TtypeExpander pass is impure (may mutate nodes in place)
     794                                // need to make nodes shared to prevent accidental mutation
     795                                ast::ptr<ast::DeclWithType> dc = d;
     796                                dc = dc->accept( expander );
     797                                auto types = flatten( dc->get_type() );
    795798                                for ( ast::ptr< ast::Type > & t : types ) {
    796799                                        // outermost const, volatile, _Atomic qualifiers in parameters should not play
     
    801804                                        // requirements than a non-mutex function
    802805                                        remove_qualifiers( t, ast::CV::Const | ast::CV::Volatile | ast::CV::Atomic );
    803                                         dst.emplace_back( new ast::ObjectDecl{ d->location, "", t } );
     806                                        dst.emplace_back( new ast::ObjectDecl{ dc->location, "", t } );
    804807                                }
    805808                        }
     
    11101113
    11111114                        ast::Pass<TtypeExpander_new> expander{ tenv };
    1112                         const ast::Type * flat = tuple->accept( expander );
    1113                         const ast::Type * flat2 = tuple2->accept( expander );
     1115
     1116                        ast::ptr<ast::TupleType> tuplec = tuple;
     1117                        ast::ptr<ast::TupleType> tuple2c = tuple2;
     1118                        const ast::Type * flat = tuplec->accept( expander );
     1119                        const ast::Type * flat2 = tuple2c->accept( expander );
    11141120
    11151121                        auto types = flatten( flat );
Note: See TracChangeset for help on using the changeset viewer.