[PATCH] D155776: [NFC] Add checks for self-assignment.
Mital Ashok via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 24 01:02:37 PDT 2023
MitalAshok added a comment.
This doesn't compile, could you fix this or revert 8ac137acefc01caf636db5f95eb0977c97def1ba <https://reviews.llvm.org/rG8ac137acefc01caf636db5f95eb0977c97def1ba> ?
================
Comment at: clang/lib/AST/APValue.cpp:393
APValue &APValue::operator=(APValue &&RHS) {
- if (Kind != None && Kind != Indeterminate)
- DestroyDataAndMakeUninit();
- Kind = RHS.Kind;
- Data = RHS.Data;
- RHS.Kind = None;
+ if (this != RHS) {
+ if (Kind != None && Kind != Indeterminate)
----------------
Ditto for the other changes
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155776/new/
https://reviews.llvm.org/D155776
More information about the cfe-commits
mailing list