OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1500515
)
Proper fix for the off-by-one bug in clear_unused_bits().
author
Evan Cheng
<evan.cheng@apple.com>
Thu, 15 Feb 2007 21:38:15 +0000
(21:38 +0000)
committer
Evan Cheng
<evan.cheng@apple.com>
Thu, 15 Feb 2007 21:38:15 +0000
(21:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34328
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
79c3f58
..
2696213
100644
(file)
--- a/
include/llvm/ADT/BitVector.h
+++ b/
include/llvm/ADT/BitVector.h
@@
-290,12
+290,10
@@
private:
// Clear the unused top bits in the high word.
void clear_unused_bits() {
- if (Size) {
- unsigned ExtraBits = Size % BITS_PER_WORD;
+ unsigned ExtraBits = Size % BITS_PER_WORD;
+ if (ExtraBits) {
unsigned index = Size / BITS_PER_WORD;
- if (Size % BITS_PER_WORD == 0)
- index--;
- Bits[index] &= ~(~0 << ExtraBits);
+ Bits[index] &= ~(~0L << ExtraBits);
}
}