74270a546c
This fixes UBsan errors like: /usr/include/c++/10/ext/ropeimpl.h:593:9: runtime error: member access within null pointer of type 'struct _RopeRep' /usr/include/c++/10/ext/ropeimpl.h:593:9: runtime error: member call on null pointer of type 'struct _Rope_rep_base' /usr/include/c++/10/ext/rope:556:17: runtime error: reference binding to null pointer of type 'struct allocator_type' /usr/include/c++/10/ext/ropeimpl.h:593:9: runtime error: reference binding to null pointer of type 'struct allocator_type' /usr/include/c++/10/ext/rope:1700:30: runtime error: member call on null pointer of type 'struct new_allocator' /usr/include/c++/10/ext/new_allocator.h:105:29: runtime error: member call on null pointer of type 'struct new_allocator' /usr/include/c++/10/ext/rope:1702:26: runtime error: reference binding to null pointer of type 'const struct allocator' /usr/include/c++/10/bits/allocator.h:148:34: runtime error: reference binding to null pointer of type 'const struct new_allocator' /usr/include/c++/10/ext/rope:1664:39: runtime error: reference binding to null pointer of type 'const struct allocator' /usr/include/c++/10/ext/rope:1665:9: runtime error: reference binding to null pointer of type 'const struct allocator_type' /usr/include/c++/10/ext/rope:725:36: runtime error: reference binding to null pointer of type 'const struct allocator_type' /usr/include/c++/10/ext/rope:614:64: runtime error: reference binding to null pointer of type 'const struct allocator_type' The problem is calling r->_M_get_allocator() when r is null. libstdc++-v3/ChangeLog: * include/ext/rope (rope::_S_concat_char_iter) (rope::_S_destr_concat_char_iter): Add allocator parameter. (rope::push_back, rope::append, rope::insert, operator+): Pass allocator. * include/ext/ropeimpl.h (rope::_S_concat_char_iter) (rope::_S_destr_concat_char_iter): Add allocator parameter and use it. (_Rope_char_ref_proxy::operator=(_CharT)): Pass allocator. |
||
---|---|---|
.. | ||
pb_ds | ||
algorithm | ||
aligned_buffer.h | ||
alloc_traits.h | ||
atomicity.h | ||
bitmap_allocator.h | ||
cast.h | ||
cmath | ||
codecvt_specializations.h | ||
concurrence.h | ||
debug_allocator.h | ||
enc_filebuf.h | ||
extptr_allocator.h | ||
functional | ||
iterator | ||
malloc_allocator.h | ||
memory | ||
mt_allocator.h | ||
new_allocator.h | ||
numeric | ||
numeric_traits.h | ||
pod_char_traits.h | ||
pointer.h | ||
pool_allocator.h | ||
random | ||
random.tcc | ||
rb_tree | ||
rc_string_base.h | ||
rope | ||
ropeimpl.h | ||
slist | ||
sso_string_base.h | ||
stdio_filebuf.h | ||
stdio_sync_filebuf.h | ||
string_conversions.h | ||
throw_allocator.h | ||
type_traits.h | ||
typelist.h | ||
vstring_fwd.h | ||
vstring_util.h | ||
vstring.h | ||
vstring.tcc |