Make sure to update the list end when an element is removed from it. This
authorChris Lattner <sabre@nondot.org>
Wed, 15 Sep 2004 17:00:41 +0000 (17:00 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 15 Sep 2004 17:00:41 +0000 (17:00 +0000)
fixes a crash in LICM when processing povray.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16367 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/AliasSetTracker.h

index 6a6f0168d2657bbef2c2ed0ae9febfdd6ee91412..fe3e60c62bbd615837ed238441b8e5650f02e14e 100644 (file)
@@ -77,6 +77,10 @@ class AliasSet {
     void removeFromList() {
       if (NextInList) NextInList->second.PrevInList = PrevInList;
       *PrevInList = NextInList;
+      if (AS->PtrListEnd == &NextInList) {
+        AS->PtrListEnd = PrevInList;
+        assert(*AS->PtrListEnd == 0 && "List not terminated right!");
+      }
     }
   };