summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2015-10-05 20:50:25 +0000
committerMarshall Clow <mclow.lists@gmail.com>2015-10-05 20:50:25 +0000
commite652e4dae1cc7e277babb3185795809a9d9fcc8c (patch)
tree9a4b37f46f2ccf74ceedb514a9504b96953e8773 /libcxx/test/std
parent5fb7d5a9e3a395207f67181fa2253f867b398632 (diff)
downloadbcm5719-llvm-e652e4dae1cc7e277babb3185795809a9d9fcc8c.tar.gz
bcm5719-llvm-e652e4dae1cc7e277babb3185795809a9d9fcc8c.zip
Fixed a possible overflow in a test of allocator::max_size().
llvm-svn: 249349
Diffstat (limited to 'libcxx/test/std')
-rw-r--r--libcxx/test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp
index 6ec9339bc48..10109383b0c 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp
@@ -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)));
}
OpenPOWER on IntegriCloud