diff --git a/llvm/include/llvm/Analysis/AliasSetTracker.h b/llvm/include/llvm/Analysis/AliasSetTracker.h index 6a6f0168d2657bbef2c2ed0ae9febfdd6ee91412..fe3e60c62bbd615837ed238441b8e5650f02e14e 100644 --- a/llvm/include/llvm/Analysis/AliasSetTracker.h +++ b/llvm/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!"); + } } };