Changeset f39096c


Ignore:
Timestamp:
Aug 23, 2016, 2:27:31 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
0555f4b, 9498fe2d
Parents:
dadc1b5
Message:

removed memory leaks due to extractAggregate calls

Location:
src/Parser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    rdadc1b5 rf39096c  
    5050        newnode->isInline = isInline;
    5151        newnode->isNoreturn = isNoreturn;
    52         newnode->bitfieldWidth = bitfieldWidth;
     52        newnode->bitfieldWidth = maybeClone( bitfieldWidth );
    5353        newnode->hasEllipsis = hasEllipsis;
    54         newnode->initializer = initializer;
     54        newnode->initializer = maybeClone( initializer );
    5555        newnode->set_next( maybeClone( get_next() ) );
    5656        newnode->linkage = linkage;
     
    804804                                        *out++ = decl;
    805805                                } // if
     806                                delete extr;
    806807                        } // if
    807808                        Declaration *decl = cur->build();
  • src/Parser/ParseNode.h

    rdadc1b5 rf39096c  
    109109        ExpressionNode( const ExpressionNode &other );
    110110        virtual ~ExpressionNode() {}
    111         virtual ExpressionNode *clone() const { assert( false ); return nullptr; }
     111        virtual ExpressionNode *clone() const { return expr ? new ExpressionNode( expr->clone() ) : nullptr; }
    112112
    113113        bool get_extension() const { return extension; }
  • src/Parser/TypeData.cc

    rdadc1b5 rf39096c  
    182182                break;
    183183          case Array:
    184                 newtype->array->dimension = array->dimension;
     184                newtype->array->dimension = maybeClone( array->dimension );
    185185                newtype->array->isVarLen = array->isVarLen;
    186186                newtype->array->isStatic = array->isStatic;
Note: See TracChangeset for help on using the changeset viewer.