mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2026-04-18 18:18:44 +00:00
Fix stack overflow detection during ASAN build. (#4642)
See discussion in issue #4638.
This commit is contained in:
parent
bdb58e042b
commit
8d069c230c
|
|
@ -8012,6 +8012,16 @@ wasm_runtime_get_module_name(wasm_module_t module)
|
|||
return "";
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
/* In few places we use addresses of local variables for estimating used stack
|
||||
size. This logic conficts with ASAN, since it uses fake stack for local
|
||||
variables storage.
|
||||
*/
|
||||
#define NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
|
||||
#else
|
||||
#define NO_SANITIZE_ADDRESS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* wasm_runtime_detect_native_stack_overflow
|
||||
*
|
||||
|
|
@ -8021,6 +8031,7 @@ wasm_runtime_get_module_name(wasm_module_t module)
|
|||
*
|
||||
* - update native_stack_top_min.
|
||||
*/
|
||||
NO_SANITIZE_ADDRESS
|
||||
bool
|
||||
wasm_runtime_detect_native_stack_overflow(WASMExecEnv *exec_env)
|
||||
{
|
||||
|
|
@ -8043,6 +8054,7 @@ wasm_runtime_detect_native_stack_overflow(WASMExecEnv *exec_env)
|
|||
return true;
|
||||
}
|
||||
|
||||
NO_SANITIZE_ADDRESS
|
||||
bool
|
||||
wasm_runtime_detect_native_stack_overflow_size(WASMExecEnv *exec_env,
|
||||
uint32 requested_size)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user