summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2016-08-13 19:46:31 +0000
committerYaron Keren <yaron.keren@gmail.com>2016-08-13 19:46:31 +0000
commit782788b7a126d5c5a75c8b1e13d8fca873ea1a9e (patch)
tree12e1c65e179a19b7493d21b484c870b062f61fe8
parent7079efe1cedc72e4618a2914a9c9daae81c47268 (diff)
downloadbcm5719-llvm-782788b7a126d5c5a75c8b1e13d8fca873ea1a9e.tar.gz
bcm5719-llvm-782788b7a126d5c5a75c8b1e13d8fca873ea1a9e.zip
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
-rw-r--r--llvm/include/llvm/ADT/DenseMap.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index a5bcb00f679..f3910b1fb9f 100644
--- 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;
}
OpenPOWER on IntegriCloud