Skip to content

Commit fd12890

Browse files
committed
Improve sanitizer detection
__has_feature(leak_sanitizer) cannot be used to detect the existence of LSan.
1 parent 777f712 commit fd12890

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

@@ -631,7 +631,7 @@ template<typename T>
631631
inline T* getContext(const T& t) {
632632
// not a leak because this is called once per binding
633633
auto* ret = new T(t);
634-
#if __has_feature(leak_sanitizer) || __has_feature(address_sanitizer)
634+
#if defined(HAS_LSAN) || __has_feature(address_sanitizer)
635635
__lsan_ignore_object(ret);
636636
#endif
637637
return ret;

0 commit comments

Comments
 (0)