Skip to content

Commit 479d0ce

Browse files
committed
Improve sanitizer detection
__has_feature(leak_sanitizer) cannot be used to detect the existence of LSan.
1 parent 84fad34 commit 479d0ce

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
@@ -26,7 +26,7 @@
2626
#include <emscripten/val.h>
2727
#include <emscripten/wire.h>
2828

29-
#if __has_feature(leak_sanitizer) || __has_feature(address_sanitizer)
29+
#if defined(HAS_LSAN) || __has_feature(address_sanitizer)
3030
#include <sanitizer/lsan_interface.h>
3131
#endif
3232

@@ -747,7 +747,7 @@ template<typename T>
747747
inline T* getContext(const T& t) {
748748
// not a leak because this is called once per binding
749749
auto* ret = new T(t);
750-
#if __has_feature(leak_sanitizer) || __has_feature(address_sanitizer)
750+
#if defined(HAS_LSAN) || __has_feature(address_sanitizer)
751751
__lsan_ignore_object(ret);
752752
#endif
753753
return ret;

0 commit comments

Comments
 (0)