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:
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 88f9ac63f7e99e9ff9ac07aabd27e1d0be6d56df..6bbe9ab46324a8fb46ea58c56c28bfad1808a7d9 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;
}