[PATCH] D123814: [compiler-rt][lsan] Update CanBeAHeapPointer for AArch64
Leonard Chan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 21 12:23:31 PDT 2022
leonardchan updated this revision to Diff 424266.
leonardchan marked an inline comment as done.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123814/new/
https://reviews.llvm.org/D123814
Files:
compiler-rt/lib/lsan/lsan_common.cpp
Index: compiler-rt/lib/lsan/lsan_common.cpp
===================================================================
--- compiler-rt/lib/lsan/lsan_common.cpp
+++ compiler-rt/lib/lsan/lsan_common.cpp
@@ -240,7 +240,7 @@
const char *Leak() { return Blue(); }
};
-static inline bool CanBeAHeapPointer(uptr p) {
+static inline bool MaybeUserPointer(uptr p) {
// Since our heap is located in mmap-ed memory, we can assume a sensible lower
// bound on heap addresses.
const uptr kMinAddress = 4 * 4096;
@@ -252,8 +252,8 @@
# elif defined(__mips64)
return ((p >> 40) == 0);
# elif defined(__aarch64__)
- unsigned runtimeVMA = (MostSignificantSetBitIndex(GET_CURRENT_FRAME()) + 1);
- return ((p >> runtimeVMA) == 0);
+ // Accept up to 48 bit VMA.
+ return ((p >> 48) == 0);
# else
return true;
# endif
@@ -276,7 +276,7 @@
pp = pp + alignment - pp % alignment;
for (; pp + sizeof(void *) <= end; pp += alignment) {
void *p = *reinterpret_cast<void **>(pp);
- if (!CanBeAHeapPointer(reinterpret_cast<uptr>(p)))
+ if (!MaybeUserPointer(reinterpret_cast<uptr>(p)))
continue;
uptr chunk = PointsIntoChunk(p);
if (!chunk)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123814.424266.patch
Type: text/x-patch
Size: 1172 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220421/bac8e622/attachment.bin>
More information about the llvm-commits
mailing list