mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-07-15 08:48:33 +00:00
Remove extra +1 from native stack guard page calculations
https://github.com/bytecodealliance/wasm-micro-runtime/issues/3297
This commit is contained in:
parent
0aeef69d23
commit
0f043dcc42
|
@ -1980,8 +1980,8 @@ invoke_native_with_hw_bound_check(WASMExecEnv *exec_env, void *func_ptr,
|
||||||
native stack to run the following codes before actually calling
|
native stack to run the following codes before actually calling
|
||||||
the aot function in invokeNative function. */
|
the aot function in invokeNative function. */
|
||||||
RECORD_STACK_USAGE(exec_env, (uint8 *)&module_inst);
|
RECORD_STACK_USAGE(exec_env, (uint8 *)&module_inst);
|
||||||
if ((uint8 *)&module_inst < exec_env->native_stack_boundary
|
if ((uint8 *)&module_inst
|
||||||
+ page_size * (guard_page_count + 1)) {
|
< exec_env->native_stack_boundary + page_size * guard_page_count) {
|
||||||
aot_set_exception_with_id(module_inst, EXCE_NATIVE_STACK_OVERFLOW);
|
aot_set_exception_with_id(module_inst, EXCE_NATIVE_STACK_OVERFLOW);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3154,8 +3154,8 @@ call_wasm_with_hw_bound_check(WASMModuleInstance *module_inst,
|
||||||
native stack to run the following codes before actually calling
|
native stack to run the following codes before actually calling
|
||||||
the aot function in invokeNative function. */
|
the aot function in invokeNative function. */
|
||||||
RECORD_STACK_USAGE(exec_env, (uint8 *)&exec_env_tls);
|
RECORD_STACK_USAGE(exec_env, (uint8 *)&exec_env_tls);
|
||||||
if ((uint8 *)&exec_env_tls < exec_env->native_stack_boundary
|
if ((uint8 *)&exec_env_tls
|
||||||
+ page_size * (guard_page_count + 1)) {
|
< exec_env->native_stack_boundary + page_size * guard_page_count) {
|
||||||
wasm_set_exception(module_inst, "native stack overflow");
|
wasm_set_exception(module_inst, "native stack overflow");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user