diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-04-12 08:33:11 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-04-12 08:33:11 +0000 |
commit | eee73f5fcff86c67f6958c3d34be5b2625d75931 (patch) | |
tree | 6411dda26f6625c5caf6ff4bd57cdeb9e08ae717 /llvm/lib/IR | |
parent | e48866969eabb2b530f8461a05cc4a3d9b0b4e7f (diff) | |
download | bcm5719-llvm-eee73f5fcff86c67f6958c3d34be5b2625d75931.tar.gz bcm5719-llvm-eee73f5fcff86c67f6958c3d34be5b2625d75931.zip |
Fix a disconcerting bug in Value::isUsedInBasicBlock, which gave wrong answers for blocks larger than 3 instrs.
Also add a unit test. PR15727.
llvm-svn: 179370
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/Value.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp index adc702e05e6..e9eb012e6ce 100644 --- a/llvm/lib/IR/Value.cpp +++ b/llvm/lib/IR/Value.cpp @@ -118,7 +118,7 @@ bool Value::isUsedInBasicBlock(const BasicBlock *BB) const { for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I) { if (std::find(I->op_begin(), I->op_end(), this) != I->op_end()) return true; - if (MaxBlockSize-- == 0) // If the block is larger fall back to use_iterator + if (--MaxBlockSize == 0) // If the block is larger fall back to use_iterator break; } |