Changes in src/SynTree/ApplicationExpr.cc [aaeacf4:0b00df0]
- File:
-
- 1 edited
-
src/SynTree/ApplicationExpr.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/ApplicationExpr.cc
raaeacf4 r0b00df0 29 29 30 30 ParamEntry::ParamEntry( const ParamEntry &other ) : 31 decl( other.decl ), declptr( maybeClone( other.declptr ) ),actualType( maybeClone( other.actualType ) ), formalType( maybeClone( other.formalType ) ), expr( maybeClone( other.expr ) )/*, inferParams( new InferredParams( *other.inferParams ) )*/ {31 decl( other.decl ), actualType( maybeClone( other.actualType ) ), formalType( maybeClone( other.formalType ) ), expr( maybeClone( other.expr ) )/*, inferParams( new InferredParams( *other.inferParams ) )*/ { 32 32 } 33 33 34 34 ParamEntry &ParamEntry::operator=( const ParamEntry &other ) { 35 35 if ( &other == this ) return *this; 36 const_cast<UniqueId &>(decl) = other.decl; 37 const_cast<Declaration * &>(declptr) = maybeClone( other.declptr ); 36 decl = other.decl; 38 37 // xxx - this looks like a memory leak 39 const_cast<Type * &>(actualType)= maybeClone( other.actualType );40 const_cast<Type * &>(formalType)= maybeClone( other.formalType );38 actualType = maybeClone( other.actualType ); 39 formalType = maybeClone( other.formalType ); 41 40 expr = maybeClone( other.expr ); 42 41 // *inferParams = *other.inferParams; … … 45 44 46 45 ParamEntry::~ParamEntry() { 47 delete declptr;48 46 delete actualType; 49 47 delete formalType; … … 52 50 53 51 ParamEntry::ParamEntry( ParamEntry && other ) : 54 decl( other.decl ), declptr( other.declptr ), actualType( other.actualType ), formalType( other.formalType ), expr( other.expr )/*, inferParams( std::move( other.inferParams ) )*/ { 55 const_cast<Declaration * &>(other.declptr) = nullptr; 56 const_cast<Type * &>(other.actualType) = nullptr; 57 const_cast<Type * &>(other.formalType) = nullptr; 52 decl( other.decl ), actualType( other.actualType ), formalType( other.formalType ), expr( other.expr )/*, inferParams( std::move( other.inferParams ) )*/ { 53 other.actualType = nullptr; 54 other.formalType = nullptr; 58 55 other.expr = nullptr; 59 56 } … … 61 58 ParamEntry & ParamEntry::operator=( ParamEntry && other ) { 62 59 if ( &other == this ) return *this; 63 delete declptr;64 60 delete actualType; 65 61 delete formalType; 66 62 delete expr; 67 const_cast<UniqueId &>(decl) = other.decl; 68 const_cast<Declaration * &>(declptr) = other.declptr; 69 const_cast<Type * &>(actualType) = other.actualType; 70 const_cast<Type * &>(formalType) = other.formalType; 63 decl = other.decl; 64 actualType = other.actualType; 65 formalType = other.formalType; 71 66 expr = other.expr; 72 const_cast<Declaration * &>(other.declptr) = nullptr; 73 const_cast<Type * &>(other.actualType) = nullptr; 74 const_cast<Type * &>(other.formalType) = nullptr; 67 other.actualType = nullptr; 68 other.formalType = nullptr; 75 69 other.expr = nullptr; 76 70 // inferParams = std::move( other.inferParams );
Note:
See TracChangeset
for help on using the changeset viewer.