diff --git a/libcxx/include/deque b/libcxx/include/deque --- a/libcxx/include/deque +++ b/libcxx/include/deque @@ -1129,7 +1129,7 @@ } _LIBCPP_HIDE_FROM_ABI - void __annotate_poison_block(void *__beginning, void *__end) { + void __annotate_poison_block(const void *__beginning, const void *__end) { __annotate_double_ended_contiguous_container(__beginning, __end, __beginning, __end, __end, __end); } @@ -1158,8 +1158,8 @@ // Pointers to first and after last elements // Those can be in different deque blocks - void* __p_beg = std::__to_address(*__first_mp + (__start_ % __block_size)); - void* __p_end = + const void* __p_beg = std::__to_address(*__first_mp + (__start_ % __block_size)); + const void* __p_end = std::__to_address(*__last_mp + ((__end % __block_size == 0) ? __block_size : __end % __block_size)); for (__map_const_iterator __it = __map_.begin(); __it != __map_.end(); ++__it) { @@ -1180,9 +1180,9 @@ std::__to_address(*__it + __block_size))) return false; } else { - void* __containers_buffer_beg = (__it == __first_mp) ? __p_beg : (void*)std::__to_address(*__it); - void* __containers_buffer_end = - (__it == __last_mp) ? __p_end : (void*)std::__to_address(*__it + __block_size); + const void* __containers_buffer_beg = (__it == __first_mp) ? __p_beg : (const void*)std::__to_address(*__it); + const void* __containers_buffer_end = + (__it == __last_mp) ? __p_end : (const void*)std::__to_address(*__it + __block_size); if (!__sanitizer_verify_double_ended_contiguous_container( std::__to_address(*__it), __containers_buffer_beg,