Add AddressSanitizer annotations to std::vector
authorJonathan Wakely <jwakely@redhat.com>
Fri, 21 Jul 2017 16:05:10 +0000 (17:05 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 21 Jul 2017 16:05:10 +0000 (17:05 +0100)
commit8c7331c5563e00e63837d0246f1325371157d46a
tree6043f52919e5b7b0577fcb51573583ea8183b79c
parent5c2dee6fc9c52bf0cb0ddbd95333ab3d0745df3b
Add AddressSanitizer annotations to std::vector

* config/allocator/malloc_allocator_base.h [__SANITIZE_ADDRESS__]
(_GLIBCXX_SANITIZE_STD_ALLOCATOR): Define.
* config/allocator/new_allocator_base.h [__SANITIZE_ADDRESS__]
(_GLIBCXX_SANITIZE_STD_ALLOCATOR): Define.
* doc/xml/manual/using.xml (_GLIBCXX_SANITIZE_VECTOR): Document macro.
* include/bits/stl_vector.h [_GLIBCXX_SANITIZE_VECTOR]
(_Vector_impl::_Asan, _Vector_impl::_Asan::_Reinit)
(_Vector_impl::_Asan::_Grow, _GLIBCXX_ASAN_ANNOTATE_REINIT)
(_GLIBCXX_ASAN_ANNOTATE_GROW, _GLIBCXX_ASAN_ANNOTATE_GREW)
(_GLIBCXX_ASAN_ANNOTATE_SHRINK, _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC):
Define annotation helper types and macros.
(vector::~vector, vector::push_back, vector::pop_back)
(vector::_M_erase_at_end): Add annotations.
* include/bits/vector.tcc (vector::reserve, vector::emplace_back)
(vector::insert, vector::_M_erase, vector::operator=)
(vector::_M_fill_assign, vector::_M_assign_aux)
(vector::_M_insert_rval, vector::_M_emplace_aux)
(vector::_M_insert_aux, vector::_M_realloc_insert)
(vector::_M_fill_insert, vector::_M_default_append)
(vector::_M_shrink_to_fit, vector::_M_range_insert): Annotate.

From-SVN: r250430
libstdc++-v3/ChangeLog
libstdc++-v3/config/allocator/malloc_allocator_base.h
libstdc++-v3/config/allocator/new_allocator_base.h
libstdc++-v3/doc/xml/manual/using.xml
libstdc++-v3/include/bits/stl_vector.h
libstdc++-v3/include/bits/vector.tcc