Ignore:
Timestamp:
Aug 23, 2017, 6:22:07 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
87e08e24, cb811ac
Parents:
9f07232 (diff), bd37119 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Alternative.cc

    r9f07232 rd3e4d6c  
    3434                : cost( cost ), cvtCost( cvtCost ), expr( expr ), env( env ) {}
    3535
    36         Alternative::Alternative( const Alternative &other ) {
    37                 initialize( other, *this );
     36        Alternative::Alternative( const Alternative &other ) : cost( other.cost ), cvtCost( other.cvtCost ), expr( maybeClone( other.expr ) ), env( other.env ) {
    3837        }
    3938
    4039        Alternative &Alternative::operator=( const Alternative &other ) {
    4140                if ( &other == this ) return *this;
    42                 initialize( other, *this );
     41                delete expr;
     42                cost = other.cost;
     43                cvtCost = other.cvtCost;
     44                expr = maybeClone( other.expr );
     45                env = other.env;
    4346                return *this;
    4447        }
     
    5760                other.expr = nullptr;
    5861                return *this;
    59         }
    60 
    61         void Alternative::initialize( const Alternative &src, Alternative &dest ) {
    62                 dest.cost = src.cost;
    63                 dest.cvtCost = src.cvtCost;
    64                 dest.expr = maybeClone( src.expr );
    65                 dest.env = src.env;
    6662        }
    6763
Note: See TracChangeset for help on using the changeset viewer.