File tree Expand file tree Collapse file tree 3 files changed +20
-15
lines changed Expand file tree Collapse file tree 3 files changed +20
-15
lines changed Original file line number Diff line number Diff line change @@ -390,11 +390,13 @@ APValue &APValue::operator=(const APValue &RHS) {
390
390
}
391
391
392
392
APValue &APValue::operator =(APValue &&RHS) {
393
- if (Kind != None && Kind != Indeterminate)
394
- DestroyDataAndMakeUninit ();
395
- Kind = RHS.Kind ;
396
- Data = RHS.Data ;
397
- RHS.Kind = None;
393
+ if (this != &RHS) {
394
+ if (Kind != None && Kind != Indeterminate)
395
+ DestroyDataAndMakeUninit ();
396
+ Kind = RHS.Kind ;
397
+ Data = RHS.Data ;
398
+ RHS.Kind = None;
399
+ }
398
400
return *this ;
399
401
}
400
402
Original file line number Diff line number Diff line change @@ -835,8 +835,10 @@ class ApplyDebugLocation {
835
835
836
836
// Define copy assignment operator.
837
837
ApplyDebugLocation &operator =(ApplyDebugLocation &&Other) {
838
- CGF = Other.CGF ;
839
- Other.CGF = nullptr ;
838
+ if (this != &Other) {
839
+ CGF = Other.CGF ;
840
+ Other.CGF = nullptr ;
841
+ }
840
842
return *this ;
841
843
}
842
844
Original file line number Diff line number Diff line change @@ -201,16 +201,17 @@ Value &Value::operator=(const Value &RHS) {
201
201
}
202
202
203
203
Value &Value::operator =(Value &&RHS) noexcept {
204
- if (IsManuallyAlloc)
205
- ValueStorage::getFromPayload (getPtr ())->Release ();
204
+ if (this != &RHS) {
205
+ if (IsManuallyAlloc)
206
+ ValueStorage::getFromPayload (getPtr ())->Release ();
206
207
207
- Interp = std::exchange (RHS.Interp , nullptr );
208
- OpaqueType = std::exchange (RHS.OpaqueType , nullptr );
209
- ValueKind = std::exchange (RHS.ValueKind , K_Unspecified);
210
- IsManuallyAlloc = std::exchange (RHS.IsManuallyAlloc , false );
211
-
212
- Data = RHS.Data ;
208
+ Interp = std::exchange (RHS.Interp , nullptr );
209
+ OpaqueType = std::exchange (RHS.OpaqueType , nullptr );
210
+ ValueKind = std::exchange (RHS.ValueKind , K_Unspecified);
211
+ IsManuallyAlloc = std::exchange (RHS.IsManuallyAlloc , false );
213
212
213
+ Data = RHS.Data ;
214
+ }
214
215
return *this ;
215
216
}
216
217
You can’t perform that action at this time.
0 commit comments