Skip to content

Commit 94314fe

Browse files
committed
Improve sanitizer detection
__has_feature(leak_sanitizer) cannot be used to detect the existence of LSan.
1 parent 094013d commit 94314fe

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
@@ -21,7 +21,7 @@
2121
#include <emscripten/val.h>
2222
#include <emscripten/wire.h>
2323

24-
#if __has_feature(leak_sanitizer) || __has_feature(address_sanitizer)
24+
#if defined(HAS_LSAN) || __has_feature(address_sanitizer)
2525
#include <sanitizer/lsan_interface.h>
2626
#endif
2727

@@ -604,7 +604,7 @@ template<typename T>
604604
inline T* getContext(const T& t) {
605605
// not a leak because this is called once per binding
606606
auto* ret = new T(t);
607-
#if __has_feature(leak_sanitizer) || __has_feature(address_sanitizer)
607+
#if defined(HAS_LSAN) || __has_feature(address_sanitizer)
608608
__lsan_ignore_object(ret);
609609
#endif
610610
return ret;

0 commit comments

Comments
 (0)