Changeset 6d160d7 for src/GenPoly


Ignore:
Timestamp:
Jan 22, 2016, 2:21:29 PM (9 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
8488c715
Parents:
32805db
Message:

Fixed type scrubbing for pointers to polymorphic generic types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/ScrubTyVars.cc

    r32805db r6d160d7  
    8282
    8383        Type * ScrubTyVars::mutate( PointerType *pointer ) {
    84                 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType * >( pointer->get_base() ) ) {
    85                         if ( tyVars.find( typeInst->get_name() ) != tyVars.end() ) {
    86                                 Type *ret = mutate( typeInst );
    87                                 ret->get_qualifiers() += pointer->get_qualifiers();
    88                                 pointer->set_base( 0 );
    89                                 delete pointer;
    90                                 return ret;
    91                         } // if
    92                 } // if
     84                if ( Type *polyType = isPolyType( pointer->get_base(), tyVars ) ) {
     85                        Type *ret = polyType->acceptMutator( *this );
     86                        ret->get_qualifiers() += pointer->get_qualifiers();
     87                        pointer->set_base( 0 );
     88                        delete pointer;
     89                        return ret;
     90                }
    9391                return Mutator::mutate( pointer );
    9492        }
Note: See TracChangeset for help on using the changeset viewer.