Add AddressSanitizer annotations to std::vector
commit09cc3d83763d20efbe1226bd6d2ae38bf1278fe6
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Jul 2017 16:05:10 +0000 (21 16:05 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Jul 2017 16:05:10 +0000 (21 16:05 +0000)
tree6043f52919e5b7b0577fcb51573583ea8183b79c
parentcdfd91503929ffb953369f6909a8dca3e42737ab
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250430 138bc75d-0d04-0410-961f-82ee72b054a4
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