From: Chris Lattner Date: Wed, 15 Sep 2004 17:00:41 +0000 (+0000) Subject: Make sure to update the list end when an element is removed from it. This X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=7e0e9c635f5439426252bd1ccbfa90b878ba0ca6;p=oota-llvm.git Make sure to update the list end when an element is removed from it. This 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 --- diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h index 6a6f0168d26..fe3e60c62bb 100644 --- a/include/llvm/Analysis/AliasSetTracker.h +++ b/include/llvm/Analysis/AliasSetTracker.h @@ -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!"); + } } };