forked from OSchip/llvm-project
Correct a glitch in r194424 which may invalidate iterator.
llvm-svn: 194457
This commit is contained in:
parent
72c83a867c
commit
f1ec34bdfd
|
@ -2730,7 +2730,9 @@ void GVN::addDeadBlock(BasicBlock *BB) {
|
|||
if (DeadBlocks.count(B))
|
||||
continue;
|
||||
|
||||
for (pred_iterator PI = pred_begin(B), PE = pred_end(B); PI != PE; PI++) {
|
||||
SmallVector<BasicBlock *, 4> Preds(pred_begin(B), pred_end(B));
|
||||
for (SmallVectorImpl<BasicBlock *>::iterator PI = Preds.begin(),
|
||||
PE = Preds.end(); PI != PE; PI++) {
|
||||
BasicBlock *P = *PI;
|
||||
|
||||
if (!DeadBlocks.count(P))
|
||||
|
|
Loading…
Reference in New Issue