Skip to content

Commit caec5f1

Browse files
Abseil Teamcopybara-github
authored andcommitted
Add weak implementation of the __lsan_is_turned_off in Leak Checker
PiperOrigin-RevId: 707155040 Change-Id: I84b84a07289334cb172d8a00674f88396ada9df6
1 parent 03c34a9 commit caec5f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

absl/debugging/leak_check.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <sanitizer/lsan_interface.h>
2929

3030
#if ABSL_HAVE_ATTRIBUTE_WEAK
31-
extern "C" ABSL_ATTRIBUTE_WEAK int __lsan_is_turned_off();
31+
extern "C" ABSL_ATTRIBUTE_WEAK int __lsan_is_turned_off() { return 0; }
3232
#endif
3333

3434
namespace absl {
@@ -37,7 +37,7 @@ bool HaveLeakSanitizer() { return true; }
3737

3838
#if ABSL_HAVE_ATTRIBUTE_WEAK
3939
bool LeakCheckerIsActive() {
40-
return !(&__lsan_is_turned_off && __lsan_is_turned_off());
40+
return __lsan_is_turned_off() == 0;
4141
}
4242
#else
4343
bool LeakCheckerIsActive() { return true; }

0 commit comments

Comments
 (0)