libstdc++: Do not use memset in _Hashtable::clear()
commit3f2f9059c7f76ff888e9d0e8f10dec6f48e346c9
authorJonathan Wakely <jwakely@redhat.com>
Mon, 10 Jun 2024 12:51:52 +0000 (10 13:51 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 12 Jun 2024 14:06:47 +0000 (12 15:06 +0100)
tree09519b032f716562d1edff0663ddef866c918539
parentadcc815a01ae009d2768b6afb546e357bd37bbd2
libstdc++: Do not use memset in _Hashtable::clear()

Using memset is incorrect if the __bucket_ptr type is non-trivial, or
does not use an all-zero bit pattern for its null value.

Replace the three uses of memset with std::fill_n to set the pointers to
nullptr.

libstdc++-v3/ChangeLog:

* include/bits/hashtable.h (_Hashtable::clear): Do not use
memset to zero out bucket pointers.
(_Hashtable::_M_assign_elements): Likewise.
libstdc++-v3/include/bits/hashtable.h