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

Wang, Xin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 6 01:41:59 PDT 2023


XinWang10 updated this revision to Diff 520045.
XinWang10 added a comment.

- resolve comment


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.520045.patch
Type: text/x-patch
Size: 357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230506/4b07c1a7/attachment.bin>


More information about the llvm-commits mailing list