Fix an iterator invalidation bug that happens when a hashtable

resizes in IPSCCP.  This fixes PR5394.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86036 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-11-04 18:57:42 +00:00
parent 17fc13f00a
commit 0fb7e18edd

View File

@ -1280,9 +1280,10 @@ CallOverdefined:
}
if (const StructType *STy = dyn_cast<StructType>(AI->getType())) {
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
mergeInValue(getStructValueState(AI, i), AI,
getStructValueState(*CAI, i));
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
LatticeVal CallArg = getStructValueState(*CAI, i);
mergeInValue(getStructValueState(AI, i), AI, CallArg);
}
} else {
mergeInValue(AI, getValueState(*CAI));
}