forked from boostorg/container
Fix integer rollover that triggers clang ubsan when U is unsigned
This commit is contained in:
1 parent
5e3e5d4fe6
commit
e0aaf744a5
1 file changed
+2
-1
@@ -963,7 +963,8 @@ template
|
||||
inline typename container_detail::disable_if_trivially_destructible<I, void>::type
|
||||
destroy_alloc_n(Allocator &a, I f, U n)
|
||||
{
|
||||
while(n--){
|
||||
while(n){
|
||||
--n;
|
||||
allocator_traits<Allocator>::destroy(a, boost::movelib::iterator_to_raw_pointer(f));
|
||||
++f;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user