aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-11-13 22:57:44 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2018-11-13 22:57:44 +0000
commit6bdd58f73a33cceba4da5966c17c356ecc22b0c6 (patch)
tree0e71c13741900a8eab433e8a507bbfe08fc89621 /gcc
parent874e50cbd5b254f1f171bf04ecdfeedc405dff5b (diff)
downloadgcc-6bdd58f73a33cceba4da5966c17c356ecc22b0c6.zip
gcc-6bdd58f73a33cceba4da5966c17c356ecc22b0c6.tar.gz
gcc-6bdd58f73a33cceba4da5966c17c356ecc22b0c6.tar.bz2
Fix overflows in std::pmr::unsynchonized_pool_resource
* src/c++17/memory_resource.cc (bitset::full()): Handle edge case for _M_next_word maximum value. (bitset::get_first_unset(), bitset::set(size_type)): Use update_next_word() to update _M_next_word. (bitset::update_next_word()): New function, avoiding wraparound of unsigned _M_next_word member. (bitset::max_word_index()): New function. (chunk::chunk(void*, uint32_t, void*, size_t)): Add assertion. (chunk::max_bytes_per_chunk()): New function. (pool::replenish(memory_resource*, const pool_options&)): Prevent _M_blocks_per_chunk from exceeding max_blocks_per_chunk or from causing chunk::max_bytes_per_chunk() to be exceeded. * testsuite/20_util/unsynchronized_pool_resource/allocate-max-chunks.cc: New test. From-SVN: r266087
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions