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; }