From caec5f1ca58830e42185bcfb4e31256f228b34a9 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Tue, 17 Dec 2024 10:28:23 -0800 Subject: [PATCH] Add weak implementation of the __lsan_is_turned_off in Leak Checker PiperOrigin-RevId: 707155040 Change-Id: I84b84a07289334cb172d8a00674f88396ada9df6 --- absl/debugging/leak_check.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/absl/debugging/leak_check.cc b/absl/debugging/leak_check.cc index 1e57e6af9b7..1370bcc4559 100644 --- a/absl/debugging/leak_check.cc +++ b/absl/debugging/leak_check.cc @@ -28,7 +28,7 @@ #include #if ABSL_HAVE_ATTRIBUTE_WEAK -extern "C" ABSL_ATTRIBUTE_WEAK int __lsan_is_turned_off(); +extern "C" ABSL_ATTRIBUTE_WEAK int __lsan_is_turned_off() { return 0; } #endif namespace absl { @@ -37,7 +37,7 @@ bool HaveLeakSanitizer() { return true; } #if ABSL_HAVE_ATTRIBUTE_WEAK bool LeakCheckerIsActive() { - return !(&__lsan_is_turned_off && __lsan_is_turned_off()); + return __lsan_is_turned_off() == 0; } #else bool LeakCheckerIsActive() { return true; }