Changes in src/ResolvExpr/Resolver.cc [1d2b64f:eeaea53]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
r1d2b64f reeaea53 404 404 template< typename AggrInst > 405 405 TypeSubstitution makeGenericSubstitutuion( AggrInst * inst ) { 406 assert( inst ); 407 assert( inst->get_baseParameters() ); 406 408 std::list< TypeDecl * > baseParams = *inst->get_baseParameters(); 407 409 std::list< Expression * > typeSubs = inst->get_parameters(); … … 444 446 445 447 void Resolver::resolveAggrInit( ReferenceToType * inst, InitIterator & init, InitIterator & initEnd ) { 446 447 448 if ( StructInstType * sit = dynamic_cast< StructInstType * >( inst ) ) { 448 449 TypeSubstitution sub = makeGenericSubstitutuion( sit ); 449 450 StructDecl * st = sit->get_baseStruct(); 451 if(st->get_members().empty()) return; 450 452 // want to resolve each initializer to the members of the struct, 451 453 // but if there are more initializers than members we should stop … … 455 457 } 456 458 } else if ( UnionInstType * uit = dynamic_cast< UnionInstType * >( inst ) ) { 457 TypeSubstitution sub = makeGenericSubstitutuion( sit );459 TypeSubstitution sub = makeGenericSubstitutuion( uit ); 458 460 UnionDecl * un = uit->get_baseUnion(); 461 if(un->get_members().empty()) return; 459 462 // only resolve to the first member of a union 460 463 resolveSingleAggrInit( *un->get_members().begin(), init, initEnd, sub );
Note: See TracChangeset
for help on using the changeset viewer.