Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r1d2b64f reeaea53  
    404404        template< typename AggrInst >
    405405        TypeSubstitution makeGenericSubstitutuion( AggrInst * inst ) {
     406                assert( inst );
     407                assert( inst->get_baseParameters() );
    406408                std::list< TypeDecl * > baseParams = *inst->get_baseParameters();
    407409                std::list< Expression * > typeSubs = inst->get_parameters();
     
    444446
    445447        void Resolver::resolveAggrInit( ReferenceToType * inst, InitIterator & init, InitIterator & initEnd ) {
    446 
    447448                if ( StructInstType * sit = dynamic_cast< StructInstType * >( inst ) ) {
    448449                        TypeSubstitution sub = makeGenericSubstitutuion( sit );
    449450                        StructDecl * st = sit->get_baseStruct();
     451                        if(st->get_members().empty()) return;
    450452                        // want to resolve each initializer to the members of the struct,
    451453                        // but if there are more initializers than members we should stop
     
    455457                        }
    456458                } else if ( UnionInstType * uit = dynamic_cast< UnionInstType * >( inst ) ) {
    457                         TypeSubstitution sub = makeGenericSubstitutuion( sit );
     459                        TypeSubstitution sub = makeGenericSubstitutuion( uit );
    458460                        UnionDecl * un = uit->get_baseUnion();
     461                        if(un->get_members().empty()) return;
    459462                        // only resolve to the first member of a union
    460463                        resolveSingleAggrInit( *un->get_members().begin(), init, initEnd, sub );
Note: See TracChangeset for help on using the changeset viewer.