Changes in / [1b0020a:242d458]


Ignore:
Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r1b0020a r242d458  
    446446                } else if ( StructInstType * st = dynamic_cast< StructInstType * >( initContext ) ) {
    447447                        resolveAggrInit( st->get_baseStruct(), iter, end );
    448                 } else if ( UnionInstType *st = dynamic_cast< UnionInstType * >( initContext ) ) {
     448                } else if ( UnionInstType * st = dynamic_cast< UnionInstType * >( initContext ) ) {
    449449                        resolveAggrInit( st->get_baseUnion(), iter, end );
     450                } else if ( TypeInstType * tt = dynamic_cast< TypeInstType * >( initContext ) ) {
     451                        Type * base = tt->get_baseType()->get_base();
     452                        if ( base ) {
     453                                // know the implementation type, so try using that as the initContext
     454                                initContext = base;
     455                                visit( listInit );
     456                        } else {
     457                                // missing implementation type -- might be an unknown type variable, so try proceeding with the current init context
     458                                Visitor::visit( listInit );
     459                        }
    450460                } else {
     461                        assert( dynamic_cast< BasicType * >( initContext ) || dynamic_cast< PointerType * >( initContext ) );
    451462                        // basic types are handled here
    452463                        Visitor::visit( listInit );
  • src/SymTab/Validate.cc

    r1b0020a r242d458  
    162162
    163163                typedef std::map< std::string, std::pair< TypedefDecl *, int > > TypedefMap;
     164                typedef std::map< std::string, TypeDecl * > TypeDeclMap;
    164165                TypedefMap typedefNames;
     166                TypeDeclMap typedeclNames;
    165167                int scopeLevel;
    166168        };
     
    521523                        delete typeInst;
    522524                        return ret;
     525                } else {
     526                        TypeDeclMap::const_iterator base = typedeclNames.find( typeInst->get_name() );
     527                        assert( base != typedeclNames.end() );
     528                        typeInst->set_baseType( base->second->clone() );
    523529                } // if
    524530                return typeInst;
     
    565571                        typedefNames.erase( i ) ;
    566572                } // if
     573
     574                typedeclNames[ typeDecl->get_name() ] = typeDecl;
    567575                return typeDecl;
    568576        }
Note: See TracChangeset for help on using the changeset viewer.