aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-17 17:29:08 +0000
committerChris Lattner <sabre@nondot.org>2004-03-17 17:29:08 +0000
commit9d5968dd51c651570c37117cb03117f8526fd62a (patch)
tree69810c58d3867c8934971e1b9b9598117c6615ed
parent835104c58e2258fb132d964e482fde3c7cd9131e (diff)
downloadexternal_llvm-9d5968dd51c651570c37117cb03117f8526fd62a.zip
external_llvm-9d5968dd51c651570c37117cb03117f8526fd62a.tar.gz
external_llvm-9d5968dd51c651570c37117cb03117f8526fd62a.tar.bz2
Fix an iterator invalidation problem in a "buggy" pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12468 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/bugpoint/TestPasses.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/bugpoint/TestPasses.cpp b/tools/bugpoint/TestPasses.cpp
index ee2c0d7..1a58e60 100644
--- a/tools/bugpoint/TestPasses.cpp
+++ b/tools/bugpoint/TestPasses.cpp
@@ -44,7 +44,7 @@ namespace {
namespace {
/// DeleteCalls - This pass is used to test bugpoint. It intentionally
- /// deletes all call instructions, "misoptimizing" the program.
+ /// deletes some call instructions, "misoptimizing" the program.
class DeleteCalls : public BasicBlockPass {
bool runOnBasicBlock(BasicBlock &BB) {
for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
@@ -52,6 +52,7 @@ namespace {
if (!CI->use_empty())
CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
CI->getParent()->getInstList().erase(CI);
+ break;
}
return false;
}