mirror of
https://github.com/boostorg/container.git
synced 2025-08-02 14:04:26 +02:00
Fix integer rollover that triggers clang ubsan when U is unsigned
This commit is contained in:
@@ -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