[libcxx-commits] [libcxx] [ASan][libc++] Turn on ASan annotations for short strings (PR #75882)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jan 16 13:51:08 PST 2024
================
@@ -74,17 +74,11 @@ TEST_CONSTEXPR bool is_string_asan_correct(const std::basic_string<ChrT, TraitsT
if (TEST_IS_CONSTANT_EVALUATED)
return true;
- if (!is_string_short(c) || _LIBCPP_SHORT_STRING_ANNOTATIONS_ALLOWED) {
----------------
ldionne wrote:
We have a bunch of existing tests where we use short strings and where you do `assert(is_string_asan_correct(s))` in the test suite. Before this patch, this would be a no-op whenever `s` was a short string, i.e. it wouldn't test anything.
My question / comment was asking for a confirmation that all methods like `basic_string::at`, `basic_string::resize` & friends are basically tested now due to this specific hunk, which makes the existing `assert`s in the test suite not no-ops anymore. If you said no, then I'd complain that we need to add tests for e.g. checking the asan-correctness of short strings w.r.t. `basic_string::resize`, and that for all other methods.
https://github.com/llvm/llvm-project/pull/75882
More information about the libcxx-commits
mailing list