From: Chris Lattner Date: Tue, 1 Jul 2003 17:10:50 +0000 (+0000) Subject: Fix major problem that was causing all kinds of nasty foldings X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=985d31215c2c3e5b2e8f7d9755158670f2c38cd4;p=oota-llvm.git Fix major problem that was causing all kinds of nasty foldings git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7034 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Analysis/DSSupport.h b/include/llvm/Analysis/DSSupport.h index 1e886fe7c26..910d1cec7bd 100644 --- a/include/llvm/Analysis/DSSupport.h +++ b/include/llvm/Analysis/DSSupport.h @@ -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; } diff --git a/include/llvm/Analysis/DataStructure/DSSupport.h b/include/llvm/Analysis/DataStructure/DSSupport.h index 1e886fe7c26..910d1cec7bd 100644 --- a/include/llvm/Analysis/DataStructure/DSSupport.h +++ b/include/llvm/Analysis/DataStructure/DSSupport.h @@ -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; }