Fixed a possible overflow in a test of allocator::max_size().
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@249349 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f956599e0e
commit
ba4775171e
@ -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)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user