projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7079efe
)
Limit DenseMap::setNumEntries input to 1<<31, in accordance with the 31 bits allocate...
author
Yaron Keren
<yaron.keren@gmail.com>
Sat, 13 Aug 2016 19:46:31 +0000
(19:46 +0000)
committer
Yaron Keren
<yaron.keren@gmail.com>
Sat, 13 Aug 2016 19:46:31 +0000
(19:46 +0000)
std::numeric_limits<int>::max() may be something else than 1<<31.
llvm-svn: 278602
llvm/include/llvm/ADT/DenseMap.h
patch
|
blob
|
history
diff --git
a/llvm/include/llvm/ADT/DenseMap.h
b/llvm/include/llvm/ADT/DenseMap.h
index
a5bcb00
..
f3910b1
100644
(file)
--- a/
llvm/include/llvm/ADT/DenseMap.h
+++ b/
llvm/include/llvm/ADT/DenseMap.h
@@
-966,8
+966,8
@@
private:
return NumEntries;
}
void setNumEntries(unsigned Num) {
- assert(Num < std::numeric_limits<int>::max() &&
-
"Cannot support more than std::numeric_limits<int>::max()
entries");
+ // NumEntries is hardcoded to be 31 bits wide.
+
assert(Num < (1U << 31) && "Cannot support more than 1<<31
entries");
NumEntries = Num;
}