aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-09-20 23:01:50 +0000
committerDevang Patel <dpatel@apple.com>2007-09-20 23:01:50 +0000
commitd15dd8c52595d5040a325052ee021d63844e28f0 (patch)
tree929468597751508648be11090026d59e861c5061 /lib/Transforms
parentd7944ca61cbe6126a8e649439488fdad7dc0d529 (diff)
downloadexternal_llvm-d15dd8c52595d5040a325052ee021d63844e28f0.zip
external_llvm-d15dd8c52595d5040a325052ee021d63844e28f0.tar.gz
external_llvm-d15dd8c52595d5040a325052ee021d63844e28f0.tar.bz2
Don't increment invalid iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42178 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/LoopIndexSplit.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopIndexSplit.cpp b/lib/Transforms/Scalar/LoopIndexSplit.cpp
index d30f18d..9e2f11b 100644
--- a/lib/Transforms/Scalar/LoopIndexSplit.cpp
+++ b/lib/Transforms/Scalar/LoopIndexSplit.cpp
@@ -928,8 +928,9 @@ void LoopIndexSplit::removeBlocks(BasicBlock *DeadBB, Loop *LP,
while (!WorkList.empty()) {
BasicBlock *BB = WorkList.back(); WorkList.pop_back();
for(BasicBlock::iterator BBI = BB->begin(), BBE = BB->end();
- BBI != BBE; ++BBI) {
+ BBI != BBE; ) {
Instruction *I = BBI;
+ ++BBI;
I->replaceAllUsesWith(UndefValue::get(I->getType()));
I->eraseFromParent();
}