diff --git a/lib/Analysis/AliasSetTracker.cpp b/lib/Analysis/AliasSetTracker.cpp index 6d09b65c6b8..39f01b613ec 100644 --- a/lib/Analysis/AliasSetTracker.cpp +++ b/lib/Analysis/AliasSetTracker.cpp @@ -374,7 +374,8 @@ void AliasSetTracker::remove(AliasSet &AS) { ++NumRefs; // Finally, remove the entry. - PointerMap.erase(P->first); + Value *Remove = P->first; + PointerMap.erase(Remove); } // Stop using the alias set, removing it.