getEntryFor() may invalidate DenseMap iterator.

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
This commit is contained in:
Devang Patel 2009-03-30 18:34:47 +00:00
parent 854b9d7623
commit 6d9a2df4ec

View 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);
}