Skip to content

Commit 26df299

Browse files
committed
Improve sanitizer detection
__has_feature(leak_sanitizer) cannot be used to detect the existence of LSan.
1 parent 9e7b313 commit 26df299

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

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

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

0 commit comments

Comments
 (0)