From 3d135cc308b90b98ff2cf92f515e0a0582cc0e4c Mon Sep 17 00:00:00 2001 From: Brandon Castellano Date: Wed, 20 Mar 2019 14:40:19 -0400 Subject: [PATCH] Get rid of integer overflow (-fsanitize=integer). --- include/boost/container/detail/copy_move_algo.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/container/detail/copy_move_algo.hpp b/include/boost/container/detail/copy_move_algo.hpp index 29d47cc..38d3b79 100644 --- a/include/boost/container/detail/copy_move_algo.hpp +++ b/include/boost/container/detail/copy_move_algo.hpp @@ -522,9 +522,9 @@ inline typename dtl::disable_if_memtransfer_copy_constructible::type { F back = r; BOOST_TRY{ - while (n--) { + while (n) { boost::container::construct_in_place(a, boost::movelib::iterator_to_raw_pointer(r), f); - ++f; ++r; + ++f; ++r; --n; } } BOOST_CATCH(...){