llvm.org GIT mirror llvm / 663c3ce
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278602 91177308-0d34-0410-b5e6-96231b3b80d8 Yaron Keren 3 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
965965 return NumEntries;
966966 }
967967 void setNumEntries(unsigned Num) {
968 assert(Num < std::numeric_limits::max() &&
969 "Cannot support more than std::numeric_limits::max() entries");
968 // NumEntries is hardcoded to be 31 bits wide.
969 assert(Num < (1U << 31) && "Cannot support more than 1<<31 entries");
970970 NumEntries = Num;
971971 }
972972