mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 01:07:04 +08:00
Fixed a possible overflow in a test of allocator::max_size().
llvm-svn: 249349
This commit is contained in:
@@ -22,6 +22,6 @@ int new_called = 0;
|
||||
int main()
|
||||
{
|
||||
const std::allocator<int> a;
|
||||
std::size_t M = a.max_size() * sizeof(int);
|
||||
assert(M > 0xFFFF && M <= std::numeric_limits<std::size_t>::max());
|
||||
std::size_t M = a.max_size();
|
||||
assert(M > 0xFFFF && M <= (std::numeric_limits<std::size_t>::max() / sizeof(int)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user