Fixed a possible overflow in a test of allocator::max_size().

llvm-svn: 249349
This commit is contained in:
Marshall Clow
2015-10-05 20:50:25 +00:00
parent 5fb7d5a9e3
commit e652e4dae1

View File

@@ -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)));
}