[PATCH] D150020: Fix possible self assign issue for DIEValue

Wang, Xin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 02:56:15 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG77bc5cc658a3: Fix possible self assign issue for DIEValue (authored by XinWang10).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150020/new/

https://reviews.llvm.org/D150020

Files:
  llvm/include/llvm/CodeGen/DIE.h


Index: llvm/include/llvm/CodeGen/DIE.h
===================================================================
--- llvm/include/llvm/CodeGen/DIE.h
+++ llvm/include/llvm/CodeGen/DIE.h
@@ -464,6 +464,8 @@
   }
 
   DIEValue &operator=(const DIEValue &X) {
+    if (this == &X)
+      return *this;
     destroyVal();
     Ty = X.Ty;
     Attribute = X.Attribute;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150020.520310.patch
Type: text/x-patch
Size: 357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230508/d718ebbc/attachment.bin>


More information about the llvm-commits mailing list