diff options
| author | Yaron Keren <yaron.keren@gmail.com> | 2016-08-13 19:46:31 +0000 |
|---|---|---|
| committer | Yaron Keren <yaron.keren@gmail.com> | 2016-08-13 19:46:31 +0000 |
| commit | 782788b7a126d5c5a75c8b1e13d8fca873ea1a9e (patch) | |
| tree | 12e1c65e179a19b7493d21b484c870b062f61fe8 | |
| parent | 7079efe1cedc72e4618a2914a9c9daae81c47268 (diff) | |
| download | bcm5719-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.h | 4 |
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; } |

