summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-12-09 04:47:21 +0000
committerChris Lattner <sabre@nondot.org>2008-12-09 04:47:21 +0000
commit56b20ffc5facbc5222992b1216ba416c038aaf22 (patch)
tree7e9ad009a88a9e82116ddcb258c93a84877156ad /llvm/lib
parent8deac5db5a0c19214cdd24ed7f0657c60bc7708f (diff)
downloadbcm5719-llvm-56b20ffc5facbc5222992b1216ba416c038aaf22.tar.gz
bcm5719-llvm-56b20ffc5facbc5222992b1216ba416c038aaf22.zip
Fix a really subtle off-by-one bug that Duncan noticed with valgrind
on test/CodeGen/Generic/2007-06-06-CriticalEdgeLandingPad. llvm-svn: 60739
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 9b792c1aca9..892b1c5b3be 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud