diff options
author | Advenam Tacet <advenam.tacet@trailofbits.com> | 2023-07-24 19:57:22 +0200 |
---|---|---|
committer | Advenam Tacet <advenam.tacet@trailofbits.com> | 2023-07-24 20:32:56 +0200 |
commit | 705fb08be1eb723994edae31aa49ff3b8fa15669 (patch) | |
tree | 43e4edba1a49cb8bc9174ca03005f5b66a3e6446 /libcxx | |
parent | 8db184ae8c4759fb3430a1f6ff0d82a0b3251274 (diff) | |
download | llvm-705fb08be1eb723994edae31aa49ff3b8fa15669.zip llvm-705fb08be1eb723994edae31aa49ff3b8fa15669.tar.gz llvm-705fb08be1eb723994edae31aa49ff3b8fa15669.tar.bz2 |
[NFC][libc++] Update comments to reflect changes in ASan
ASan capabilities were extended, but some comments were not updated and describe old behavior. This commit updates outdated comments, which I found.
Mentioned changes are:
- All allocators in containers (`std::vector` and `std::deque`; D146815 D136765) are supported, but it's possible to turn off annotations for a specific allocator (D145628).
- Buffers don't have to be aligned (D132522).
Reviewed By: #libc, philnik
Differential Revision: https://reviews.llvm.org/D156155
Diffstat (limited to 'libcxx')
-rw-r--r-- | libcxx/include/deque | 7 | ||||
-rw-r--r-- | libcxx/include/vector | 9 |
2 files changed, 12 insertions, 4 deletions
diff --git a/libcxx/include/deque b/libcxx/include/deque index 777f935..8ca5943 100644 --- a/libcxx/include/deque +++ b/libcxx/include/deque @@ -968,7 +968,12 @@ public: }; // The following functions are no-ops outside of AddressSanitizer mode. -// We call annotations only for the default Allocator. +// We call annotations for every allocator, unless explicitly disabled. +// +// To disable annotations for a particular allocator, change value of +// __asan_annotate_container_with_allocator to false. +// For more details, see the "Using libc++" documentation page or +// the documentation for __sanitizer_annotate_contiguous_container. #if !defined(_LIBCPP_HAS_NO_ASAN) && _LIBCPP_CLANG_VER >= 1600 // TODO LLVM18: Remove the special-casing _LIBCPP_HIDE_FROM_ABI void __annotate_double_ended_contiguous_container( diff --git a/libcxx/include/vector b/libcxx/include/vector index 19bf495..ec97457 100644 --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -840,9 +840,12 @@ private: inline void __emplace_back_slow_path(_Args&&... __args); // The following functions are no-ops outside of AddressSanitizer mode. - // We call annotatations only for the default Allocator because other allocators - // may not meet the AddressSanitizer alignment constraints. - // See the documentation for __sanitizer_annotate_contiguous_container for more details. + // We call annotations for every allocator, unless explicitly disabled. + // + // To disable annotations for a particular allocator, change value of + // __asan_annotate_container_with_allocator to false. + // For more details, see the "Using libc++" documentation page or + // the documentation for __sanitizer_annotate_contiguous_container. #ifndef _LIBCPP_HAS_NO_ASAN _LIBCPP_CONSTEXPR_SINCE_CXX20 void __annotate_contiguous_container(const void *__beg, const void *__end, |