Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit fe1138b

Browse files
committed
https://github.com/bytecodealliance/wasm-micro-runtime/pull/4196
1 parent b9bf9e9 commit fe1138b

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

core/iwasm/aot/aot_runtime.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,12 +2246,6 @@ invoke_native_with_hw_bound_check(WASMExecEnv *exec_env, void *func_ptr,
22462246
#endif
22472247
bool ret;
22482248

2249-
/* Check native stack overflow firstly to ensure we have enough
2250-
native stack to run the following codes before actually calling
2251-
the aot function in invokeNative function. */
2252-
if (!wasm_runtime_detect_native_stack_overflow(exec_env)) {
2253-
return false;
2254-
}
22552249

22562250
if (!exec_env_tls) {
22572251
if (!os_thread_signal_inited()) {
@@ -2271,6 +2265,12 @@ invoke_native_with_hw_bound_check(WASMExecEnv *exec_env, void *func_ptr,
22712265
}
22722266
}
22732267

2268+
/* Check native stack overflow firstly to ensure we have enough
2269+
native stack to run the following codes before actually calling
2270+
the aot function in invokeNative function. */
2271+
if (!wasm_runtime_detect_native_stack_overflow(exec_env)) {
2272+
return false;
2273+
}
22742274
wasm_exec_env_push_jmpbuf(exec_env, &jmpbuf_node);
22752275

22762276
if (os_setjmp(jmpbuf_node.jmpbuf) == 0) {

core/iwasm/interpreter/wasm_runtime.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3523,12 +3523,6 @@ call_wasm_with_hw_bound_check(WASMModuleInstance *module_inst,
35233523
#endif
35243524
bool ret = true;
35253525

3526-
/* Check native stack overflow firstly to ensure we have enough
3527-
native stack to run the following codes before actually calling
3528-
the aot function in invokeNative function. */
3529-
if (!wasm_runtime_detect_native_stack_overflow(exec_env)) {
3530-
return;
3531-
}
35323526

35333527
if (!exec_env_tls) {
35343528
if (!os_thread_signal_inited()) {
@@ -3547,7 +3541,12 @@ call_wasm_with_hw_bound_check(WASMModuleInstance *module_inst,
35473541
return;
35483542
}
35493543
}
3550-
3544+
/* Check native stack overflow firstly to ensure we have enough
3545+
native stack to run the following codes before actually calling
3546+
the aot function in invokeNative function. */
3547+
if (!wasm_runtime_detect_native_stack_overflow(exec_env)) {
3548+
return;
3549+
}
35513550
wasm_exec_env_push_jmpbuf(exec_env, &jmpbuf_node);
35523551

35533552
if (os_setjmp(jmpbuf_node.jmpbuf) == 0) {

0 commit comments

Comments
 (0)