diff options
author | Chris Lattner <sabre@nondot.org> | 2008-12-09 04:47:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-12-09 04:47:21 +0000 |
commit | 46a879ebd384fb39cb680e4c3c182fefcdef5778 (patch) | |
tree | 31b1eaff4d60d8a8cb5b2c7fa5b0dfdd3c424f42 | |
parent | e07d3dead1f6948e43d9611197aaac44db33e5b3 (diff) |
Fix a really subtle off-by-one bug that Duncan noticed with valgrind
on test/CodeGen/Generic/2007-06-06-CriticalEdgeLandingPad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60739 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 9b792c1aca..892b1c5b3b 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -249,7 +249,7 @@ void LoopStrengthReduce::DeleteTriviallyDeadInstructions() { for (unsigned i = 0, e = DeadInsts.size()-1; i < e; ++i) { Instruction *I = DeadInsts[i]; if (!I->use_empty()) DeadInsts[i] = 0; - while (DeadInsts[i+1] == I && i != e) + while (i != e && DeadInsts[i+1] == I) DeadInsts[++i] = 0; } |