diff options
author | Leonard Grey <lgrey@chromium.org> | 2022-09-01 10:58:13 -0400 |
---|---|---|
committer | Leonard Grey <lgrey@chromium.org> | 2022-09-02 11:25:22 -0400 |
commit | f458d9f6f892c3765174ad8f0cc912d930329f43 (patch) | |
tree | 195fdad6b09a6aa5fa4bc7925d9eb5dbee0517ab /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 5cf510115afd54d0f45035957a9ad0e3425bee6c (diff) | |
download | llvm-f458d9f6f892c3765174ad8f0cc912d930329f43.zip llvm-f458d9f6f892c3765174ad8f0cc912d930329f43.tar.gz llvm-f458d9f6f892c3765174ad8f0cc912d930329f43.tar.bz2 |
[lsan][darwin] Unmask camouflaged class_rw_t pointers
Detailed motivation here: https://docs.google.com/document/d/1xUNo5ovPKJMYxitiHUQVRxGI3iUmspI51Jm4w8puMwo
check-asan (with LSAN enabled) and check-lsan are currently broken on recent macOS versions, due to pervasive false positives. Whenever the Objective-C runtime realizes a class, it allocates data for it, then stores that data with flags in the low bits. This means LSAN can not recognize it as a pointer while scanning.
This change checks every potential pointer on Apple platforms, and if the high bit is set, attempts to extract a pointer by masking out the high bit and flags. This is ugly, but it's also the best approach I could think of (see doc above); very open to other suggestions.
Differential Revision: https://reviews.llvm.org/D133126
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions