diff options
author | Leonard Chan <leonardchan@google.com> | 2022-05-24 10:22:46 -0700 |
---|---|---|
committer | Leonard Chan <leonardchan@google.com> | 2022-05-24 10:22:46 -0700 |
commit | c8644ea88ea220a28ef41b7364ca2eb1071552f9 (patch) | |
tree | db885d3688c6cd7987571d7b65488a399dc6263d /clang/lib/Sema/SemaOpenMP.cpp | |
parent | 175833ed6f62b697ce6248930da54e4ddb7f4c00 (diff) | |
download | llvm-c8644ea88ea220a28ef41b7364ca2eb1071552f9.zip llvm-c8644ea88ea220a28ef41b7364ca2eb1071552f9.tar.gz llvm-c8644ea88ea220a28ef41b7364ca2eb1071552f9.tar.bz2 |
[compiler-rt][lsan] Update CanBeAHeapPointer for AArch64
While attempting to get the 64-bit lsan allocator working for Fuchsia, I
noticed this function would incorrectly return false for pointers returned
by the 64-bit allocator. On AArch64, this function attempts to get the VMA
size dynamically by counting the number of leading zeros from the function
frame address. This will fail if the frame address is significantly below an
allocated pointer (that is, the frame address has more leading zeros than an
allocated pointer). This is possible on Fuchsia and linux (when not called
from the initial thread stack).
It seems the intended use of this function is to speed up pointer scanning by
filtering out addresses that user code might not be able to access. Other
platforms this check is done on seem to hardcode the VMA size/shift, so it
seems appropriate to do this for aarch64 as well. This implies pointers on
aarch64 where the VMA size is <64 will pass through, but bad pointers will
still be caught by subsequent scan checks.
This patch also renames the function to something more fitting of what it's
trying to do.
Differential Revision: https://reviews.llvm.org/D123814
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
0 files changed, 0 insertions, 0 deletions