mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-27 06:54:30 +00:00
Fix this code so that it doesn't try to iterate through a std::vector
while calling changeImmediateDominator, which removes elements from the vector. This fixes PR5097. llvm-svn: 83166
This commit is contained in:
parent
4c0732ea64
commit
2ecc146f0c
@ -274,9 +274,10 @@ ReprocessLoop:
|
||||
DomTreeNode *Node = DT->getNode(ExitingBlock);
|
||||
const std::vector<DomTreeNodeBase<BasicBlock> *> &Children =
|
||||
Node->getChildren();
|
||||
for (unsigned k = 0, g = Children.size(); k != g; ++k) {
|
||||
DT->changeImmediateDominator(Children[k], Node->getIDom());
|
||||
if (DF) DF->changeImmediateDominator(Children[k]->getBlock(),
|
||||
while (!Children.empty()) {
|
||||
DomTreeNode *Child = Children.front();
|
||||
DT->changeImmediateDominator(Child, Node->getIDom());
|
||||
if (DF) DF->changeImmediateDominator(Child->getBlock(),
|
||||
Node->getIDom()->getBlock(),
|
||||
DT);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user