forked from OSchip/llvm-project
Limit DenseMap::setNumEntries input to 1<<31, in accordance with the 31 bits allocated to NumEntries.
std::numeric_limits<int>::max() may be something else than 1<<31. llvm-svn: 278602
This commit is contained in:
parent
7079efe1ce
commit
782788b7a1
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue