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:
409d64a
)
Bounds-check APInt's operator[].
author
Dan Gohman
<gohman@apple.com>
Thu, 18 Nov 2010 17:14:56 +0000
(17:14 +0000)
committer
Dan Gohman
<gohman@apple.com>
Thu, 18 Nov 2010 17:14:56 +0000
(17:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119708
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Support/APInt.cpp
patch
|
blob
|
history
diff --git
a/lib/Support/APInt.cpp
b/lib/Support/APInt.cpp
index
88f9ac6
..
6bbe9ab
100644
(file)
--- a/
lib/Support/APInt.cpp
+++ b/
lib/Support/APInt.cpp
@@
-483,6
+483,7
@@
APInt APInt::operator-(const APInt& RHS) const {
}
bool APInt::operator[](unsigned bitPosition) const {
+ assert(bitPosition < getBitWidth() && "Bit position out of bounds!");
return (maskBit(bitPosition) &
(isSingleWord() ? VAL : pVal[whichWord(bitPosition)])) != 0;
}