Add more operand stack overflow checks for fast-interp (#1104)
And clear some compile warnings on Windows
This commit is contained in:
@ -3602,6 +3602,13 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
{
|
||||
outs_area->lp = outs_area->operand + cur_func->const_cell_num;
|
||||
}
|
||||
|
||||
if ((uint8 *)(outs_area->lp + cur_func->param_cell_num)
|
||||
> exec_env->wasm_stack.s.top_boundary) {
|
||||
wasm_set_exception(module, "wasm operand stack overflow");
|
||||
goto got_exception;
|
||||
}
|
||||
|
||||
for (i = 0; i < cur_func->param_count; i++) {
|
||||
if (cur_func->param_types[i] == VALUE_TYPE_I64
|
||||
|| cur_func->param_types[i] == VALUE_TYPE_F64) {
|
||||
@ -3790,6 +3797,13 @@ wasm_interp_call_wasm(WASMModuleInstance *module_inst, WASMExecEnv *exec_env,
|
||||
frame->lp = frame->operand + 0;
|
||||
frame->ret_offset = 0;
|
||||
|
||||
if ((uint8 *)(outs_area->operand + function->const_cell_num + argc)
|
||||
> exec_env->wasm_stack.s.top_boundary) {
|
||||
wasm_set_exception((WASMModuleInstance *)exec_env->module_inst,
|
||||
"wasm operand stack overflow");
|
||||
return;
|
||||
}
|
||||
|
||||
if (argc > 0)
|
||||
word_copy(outs_area->operand + function->const_cell_num, argv, argc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user