Skip to content

Commit 41e9bf2

Browse files
committed
Improve sanitizer detection
__has_feature(leak_sanitizer) cannot be used to detect the existence of LSan.
1 parent 57833e2 commit 41e9bf2

File tree

1 file changed

+2
-2
lines changed
  • system/include/emscripten

1 file changed

+2
-2
lines changed

system/include/emscripten/bind.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <emscripten/val.h>
2424
#include <emscripten/wire.h>
2525

26-
#if __has_feature(leak_sanitizer) || __has_feature(address_sanitizer)
26+
#if defined(HAS_LSAN) || __has_feature(address_sanitizer)
2727
#include <sanitizer/lsan_interface.h>
2828
#endif
2929

@@ -700,7 +700,7 @@ template<typename T>
700700
inline T* getContext(const T& t) {
701701
// not a leak because this is called once per binding
702702
auto* ret = new T(t);
703-
#if __has_feature(leak_sanitizer) || __has_feature(address_sanitizer)
703+
#if defined(HAS_LSAN) || __has_feature(address_sanitizer)
704704
__lsan_ignore_object(ret);
705705
#endif
706706
return ret;

0 commit comments

Comments
 (0)