File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -7884,6 +7884,24 @@ wasm_runtime_get_module_name(wasm_module_t module)
78847884bool
78857885wasm_runtime_detect_native_stack_overflow (WASMExecEnv * exec_env )
78867886{
7887+ #if defined(__has_feature )
7888+ #if __has_feature (address_sanitizer )
7889+ // ASAN build with clang++
7890+ #define BUILD_ASAN 1
7891+ #endif
7892+ #endif
7893+
7894+ #ifdef __SANITIZE_ADDRESS__
7895+ // ASAN build with g++
7896+ #define BUILD_ASAN 1
7897+ #endif
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+ #endif
78877905 uint8 * boundary = exec_env -> native_stack_boundary ;
78887906 RECORD_STACK_USAGE (exec_env , (uint8 * )& boundary );
78897907 if (boundary == NULL ) {
You can’t perform that action at this time.
0 commit comments