mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-15 07:33:18 +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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83166 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3a90c9b8ed
commit
5184635eda
@ -274,9 +274,10 @@ ReprocessLoop:
|
|||||||
DomTreeNode *Node = DT->getNode(ExitingBlock);
|
DomTreeNode *Node = DT->getNode(ExitingBlock);
|
||||||
const std::vector<DomTreeNodeBase<BasicBlock> *> &Children =
|
const std::vector<DomTreeNodeBase<BasicBlock> *> &Children =
|
||||||
Node->getChildren();
|
Node->getChildren();
|
||||||
for (unsigned k = 0, g = Children.size(); k != g; ++k) {
|
while (!Children.empty()) {
|
||||||
DT->changeImmediateDominator(Children[k], Node->getIDom());
|
DomTreeNode *Child = Children.front();
|
||||||
if (DF) DF->changeImmediateDominator(Children[k]->getBlock(),
|
DT->changeImmediateDominator(Child, Node->getIDom());
|
||||||
|
if (DF) DF->changeImmediateDominator(Child->getBlock(),
|
||||||
Node->getIDom()->getBlock(),
|
Node->getIDom()->getBlock(),
|
||||||
DT);
|
DT);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user