Fix major problem that was causing all kinds of nasty foldings
authorChris Lattner <sabre@nondot.org>
Tue, 1 Jul 2003 17:10:50 +0000 (17:10 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 1 Jul 2003 17:10:50 +0000 (17:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7034 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DSSupport.h
include/llvm/Analysis/DataStructure/DSSupport.h

index 1e886fe7c26da97cafa5e16dd2afabed4aea2490..910d1cec7bdb2c9d0d84760ff3f210bf00c3ef87 100644 (file)
@@ -60,6 +60,7 @@ public:
   }
   ~DSNodeHandle() { setNode((DSNode*)0); }
   DSNodeHandle &operator=(const DSNodeHandle &H) {
+    if (&H != this) return *this;  // Don't set offset to 0 if self assigning.
     Offset = 0; setNode(H.getNode()); Offset = H.Offset;
     return *this;
   }
index 1e886fe7c26da97cafa5e16dd2afabed4aea2490..910d1cec7bdb2c9d0d84760ff3f210bf00c3ef87 100644 (file)
@@ -60,6 +60,7 @@ public:
   }
   ~DSNodeHandle() { setNode((DSNode*)0); }
   DSNodeHandle &operator=(const DSNodeHandle &H) {
+    if (&H != this) return *this;  // Don't set offset to 0 if self assigning.
     Offset = 0; setNode(H.getNode()); Offset = H.Offset;
     return *this;
   }