Skip to content

Commit f7d8d20

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

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

@@ -648,7 +648,7 @@ template<typename T>
648648
inline T* getContext(const T& t) {
649649
// not a leak because this is called once per binding
650650
auto* ret = new T(t);
651-
#if __has_feature(leak_sanitizer) || __has_feature(address_sanitizer)
651+
#if defined(HAS_LSAN) || __has_feature(address_sanitizer)
652652
__lsan_ignore_object(ret);
653653
#endif
654654
return ret;

0 commit comments

Comments
 (0)