Fix a really nasty bug with the -disable-ds-field-sensitivity option
authorChris Lattner <sabre@nondot.org>
Sun, 23 May 2004 21:14:09 +0000 (21:14 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 23 May 2004 21:14:09 +0000 (21:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13681 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/Local.cpp

index c969cc6621b4afe4c2f5e3c5bec018d5397612d1..995c115af9f10fda7e067e8c3013332603a279c9 100644 (file)
@@ -130,6 +130,9 @@ namespace {
     DSNode *createNode(const Type *Ty = 0) {
       DSNode *N = new DSNode(Ty, &G);   // Create the node
       if (DisableFieldSensitivity) {
+        // Create node handle referring to the old node so that it is
+        // immediately removed from the graph when the node handle is destroyed.
+        DSNodeHandle OldNNH = N;
         N->foldNodeCompletely();
         if (DSNode *FN = N->getForwardNode())
           N = FN;