Fix PR912. The input to erase() must not be a reference to the data
authorNick Lewycky <nicholas@mxc.ca>
Sun, 17 Sep 2006 16:23:36 +0000 (16:23 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sun, 17 Sep 2006 16:23:36 +0000 (16:23 +0000)
being erased.

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

lib/Analysis/AliasSetTracker.cpp

index 6d09b65c6b8dfb514ad463161f6a24fbead3ac3b..39f01b613eced39093505da56e032a74d07feb9c 100644 (file)
@@ -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.