We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6a9f1f commit db72eeaCopy full SHA for db72eea
1 file changed
core/iwasm/common/wasm_runtime_common.c
@@ -7884,6 +7884,24 @@ wasm_runtime_get_module_name(wasm_module_t module)
7884
bool
7885
wasm_runtime_detect_native_stack_overflow(WASMExecEnv *exec_env)
7886
{
7887
+#if defined(__has_feature)
7888
+#if __has_feature(address_sanitizer)
7889
+// ASAN build with clang++
7890
+#define BUILD_ASAN 1
7891
+#endif
7892
7893
+
7894
+#ifdef __SANITIZE_ADDRESS__
7895
+// ASAN build with g++
7896
7897
7898
7899
+#ifdef BUILD_ASAN
7900
+ // ASAN uses fake stack for local variables storage, so we can not
7901
+ // properly detect stack overflow with it.
7902
+ return true;
7903
+#undef BUILD_ASAN
7904
7905
uint8 *boundary = exec_env->native_stack_boundary;
7906
RECORD_STACK_USAGE(exec_env, (uint8 *)&boundary);
7907
if (boundary == NULL) {
0 commit comments