Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    reeaea53 r1d2b64f  
    404404        template< typename AggrInst >
    405405        TypeSubstitution makeGenericSubstitutuion( AggrInst * inst ) {
    406                 assert( inst );
    407                 assert( inst->get_baseParameters() );
    408406                std::list< TypeDecl * > baseParams = *inst->get_baseParameters();
    409407                std::list< Expression * > typeSubs = inst->get_parameters();
     
    446444
    447445        void Resolver::resolveAggrInit( ReferenceToType * inst, InitIterator & init, InitIterator & initEnd ) {
     446
    448447                if ( StructInstType * sit = dynamic_cast< StructInstType * >( inst ) ) {
    449448                        TypeSubstitution sub = makeGenericSubstitutuion( sit );
    450449                        StructDecl * st = sit->get_baseStruct();
    451                         if(st->get_members().empty()) return;
    452450                        // want to resolve each initializer to the members of the struct,
    453451                        // but if there are more initializers than members we should stop
     
    457455                        }
    458456                } else if ( UnionInstType * uit = dynamic_cast< UnionInstType * >( inst ) ) {
    459                         TypeSubstitution sub = makeGenericSubstitutuion( uit );
     457                        TypeSubstitution sub = makeGenericSubstitutuion( sit );
    460458                        UnionDecl * un = uit->get_baseUnion();
    461                         if(un->get_members().empty()) return;
    462459                        // only resolve to the first member of a union
    463460                        resolveSingleAggrInit( *un->get_members().begin(), init, initEnd, sub );
Note: See TracChangeset for help on using the changeset viewer.