getEntryFor() may invalidate DenseMap iterator.
authorDevang Patel <dpatel@apple.com>
Mon, 30 Mar 2009 18:34:47 +0000 (18:34 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 30 Mar 2009 18:34:47 +0000 (18:34 +0000)
Walking an invalidated iterator is not a good idea.

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

lib/Analysis/AliasSetTracker.cpp

index a386a494fca020240cd6be84b6955b6c635a957e..18c2b66505f636811c4338b0974bb3bb1b3464e6 100644 (file)
@@ -520,6 +520,7 @@ void AliasSetTracker::copyValue(Value *From, Value *To) {
   if (Entry.hasAliasSet()) return;    // Already in the tracker!
 
   // Add it to the alias set it aliases...
+  I = PointerMap.find(From);
   AliasSet *AS = I->second->getAliasSet(*this);
   AS->addPointer(*this, Entry, I->second->getSize(), true);
 }