diff options
author | Dominic Chen <1108560+ddcc@users.noreply.github.com> | 2025-01-20 05:57:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-20 08:57:52 -0500 |
commit | 9b853f63bef20fd1f19ec933667b1f619afc0f1d (patch) | |
tree | 6b4b43b0765bb5e7c2df3093895a71c7d8c3e301 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 977d744b21d06415ac872258bf86e026d8eb487f (diff) | |
download | llvm-9b853f63bef20fd1f19ec933667b1f619afc0f1d.zip llvm-9b853f63bef20fd1f19ec933667b1f619afc0f1d.tar.gz llvm-9b853f63bef20fd1f19ec933667b1f619afc0f1d.tar.bz2 |
[libc++] Fix vector sanitization annotations on destruction (#121031)
In https://reviews.llvm.org/D136765 / https://reviews.llvm.org/D144155,
the asan annotations for `std::vector` were modified to unpoison freed
backing memory on destruction, instead of leaving it poisoned. However,
calling `__clear()` instead of `clear()` skips informing the asan runtime
of this decrease in the accessible container size, which breaks the
invariant that the value of `old_mid` should match the value of `new_mid`
from the previous call to `__sanitizer_annotate_contiguous_container`, which
can trip the sanity checks for the partial poison between [d1, d2) and the
container redzone between [d2, c), if enabled. To fix this, ensure that
`clear()` is called instead, as is already done by `__vdeallocate()`.
Also remove `__clear()`, since it is no longer called.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions