Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/ScrubTyVars.cc

    r68f9c43 rb8a4f47  
    2828                if ( ! tyVars ) {
    2929                        if ( typeInst->get_isFtype() ) {
    30                                 return new PointerType{ Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) };
     30                                delete typeInst;
     31                                return new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) );
    3132                        } else {
    32                                 return new PointerType{ Type::Qualifiers(), new VoidType( typeInst->get_qualifiers() ) };
     33                                PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( typeInst->get_qualifiers() ) );
     34                                delete typeInst;
     35                                return ret;
    3336                        }
    3437                }
     
    3942                          case TypeDecl::Dtype:
    4043                          case TypeDecl::Ttype:
    41                                 return new PointerType{ Type::Qualifiers(), new VoidType( typeInst->get_qualifiers() ) };
     44                                {
     45                                        PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( typeInst->get_qualifiers() ) );
     46                                        delete typeInst;
     47                                        return ret;
     48                                }
    4249                          case TypeDecl::Ftype:
    43                                 return new PointerType{ Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) };
     50                                delete typeInst;
     51                                return new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) );
    4452                        } // switch
    4553                } // if
     
    4957        Type * ScrubTyVars::mutateAggregateType( Type * ty ) {
    5058                if ( shouldScrub( ty ) ) {
    51                         return new PointerType{ Type::Qualifiers(), new VoidType( ty->get_qualifiers() ) };
     59                        PointerType * ret = new PointerType( Type::Qualifiers(), new VoidType( ty->get_qualifiers() ) );
     60                        delete ty;
     61                        return ret;
    5262                }
    5363                return ty;
     
    94104                        Type * ret = dynType->acceptMutator( *visitor );
    95105                        ret->get_qualifiers() |= pointer->get_qualifiers();
     106                        pointer->base = nullptr;
     107                        delete pointer;
    96108                        return ret;
    97109                }
Note: See TracChangeset for help on using the changeset viewer.