mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
Fix use_iterator crash in ObjCArc from r203364
The use_iterator redesign in r203364 introduced an increment past the end of a range in -objc-arc-contract. Added an explicit check for the end of the range. <rdar://problem/16333235> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204195 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -475,8 +475,9 @@ bool ObjCARCContract::runOnFunction(Function &F) {
|
||||
for (unsigned i = 0, e = PHI->getNumIncomingValues(); i != e; ++i)
|
||||
if (PHI->getIncomingBlock(i) == BB) {
|
||||
// Keep the UI iterator valid.
|
||||
if (&PHI->getOperandUse(
|
||||
PHINode::getOperandNumForIncomingValue(i)) == &U)
|
||||
if (UI != UE &&
|
||||
&PHI->getOperandUse(
|
||||
PHINode::getOperandNumForIncomingValue(i)) == &*UI)
|
||||
++UI;
|
||||
PHI->setIncomingValue(i, Replacement);
|
||||
}
|
||||
|
Reference in New Issue
Block a user