commit | ba4775171eaddf8e8e053dc1a85f13bce987c086 | [log] [tgz] |
---|---|---|
author | Marshall Clow <mclow.lists@gmail.com> | Mon Oct 05 20:50:25 2015 +0000 |
committer | Marshall Clow <mclow.lists@gmail.com> | Mon Oct 05 20:50:25 2015 +0000 |
tree | a9a9173d633f1a691c613fb34460b112dbfc3fce | |
parent | f956599e0ee534c22800c2d70f799bf4d9212a4f [diff] |
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
diff --git a/test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp b/test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp index 6ec9339..1010938 100644 --- a/test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp +++ b/test/std/utilities/memory/default.allocator/allocator.members/max_size.pass.cpp
@@ -22,6 +22,6 @@ 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))); }