[compiler-rt] b5fa4fe - [lsan] Fix compilation on Android (#113003)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 18 18:40:32 PDT 2024
Author: Vitaly Buka
Date: 2024-10-18T18:40:29-07:00
New Revision: b5fa4fee46c1d0046cc395e3338ae13fe6e2cb84
URL: https://github.com/llvm/llvm-project/commit/b5fa4fee46c1d0046cc395e3338ae13fe6e2cb84
DIFF: https://github.com/llvm/llvm-project/commit/b5fa4fee46c1d0046cc395e3338ae13fe6e2cb84.diff
LOG: [lsan] Fix compilation on Android (#113003)
Added:
Modified:
compiler-rt/lib/lsan/lsan_common.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/lsan/lsan_common.cpp b/compiler-rt/lib/lsan/lsan_common.cpp
index 25d79544b2f35d..5c44c000ae577b 100644
--- a/compiler-rt/lib/lsan/lsan_common.cpp
+++ b/compiler-rt/lib/lsan/lsan_common.cpp
@@ -521,13 +521,14 @@ static void ProcessThread(tid_t os_id, uptr sp,
}
}
# if SANITIZER_ANDROID
+ extra_ranges.clear();
auto *cb = +[](void *dtls_begin, void *dtls_end, uptr /*dso_idd*/,
void *arg) -> void {
- ScanForPointers(
- reinterpret_cast<uptr>(dtls_begin), reinterpret_cast<uptr>(dtls_end),
- reinterpret_cast<Frontier *>(arg), "DTLS", kReachable, accessor);
+ reinterpret_cast<InternalMmapVector<Range> *>(arg)->push_back(
+ {reinterpret_cast<uptr>(dtls_begin),
+ reinterpret_cast<uptr>(dtls_end)});
};
-
+ ScanRanges(extra_ranges, frontier, "DTLS", accessor);
// FIXME: There might be a race-condition here (and in Bionic) if the
// thread is suspended in the middle of updating its DTLS. IOWs, we
// could scan already freed memory. (probably fine for now)
More information about the llvm-commits
mailing list