projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d1597b
)
Fix an off-by-one bug in computing the index of the word to clear.
author
Reid Spencer
<rspencer@reidspencer.com>
Thu, 15 Feb 2007 20:49:10 +0000
(20:49 +0000)
committer
Reid Spencer
<rspencer@reidspencer.com>
Thu, 15 Feb 2007 20:49:10 +0000
(20:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34326
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/BitVector.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/BitVector.h
b/include/llvm/ADT/BitVector.h
index 39819ee5c829cfe3590158129768fd4dc019449c..79c3f585677353e7219029879ce0c2c12190d3d4 100644
(file)
--- a/
include/llvm/ADT/BitVector.h
+++ b/
include/llvm/ADT/BitVector.h
@@
-292,7
+292,10
@@
private:
void clear_unused_bits() {
if (Size) {
unsigned ExtraBits = Size % BITS_PER_WORD;
- Bits[Size / BITS_PER_WORD] &= ~(~0 << ExtraBits);
+ unsigned index = Size / BITS_PER_WORD;
+ if (Size % BITS_PER_WORD == 0)
+ index--;
+ Bits[index] &= ~(~0 << ExtraBits);
}
}