Refine codes and fix several issues (#882)
Refine some codes in wasm loader Add -Wshadow to gcc compile flags and fix some variable shadowed issues Fix function parameter/return types not checked issue Fix fast-interp loader reserve_block_ret() not handle V128 return type issue Fix mini loader load_table_segment_section() failed issue Add detailed comments for argc argument in wasm_runtime_call_wasm()
This commit is contained in:
@ -216,8 +216,6 @@ table_instantiate(AOTModuleInstance *module_inst, AOTModule *module,
|
||||
|
||||
/* fill table with element segment content */
|
||||
for (i = 0; i < module->table_init_data_count; i++) {
|
||||
AOTTableInstance *tbl_inst;
|
||||
|
||||
table_seg = module->table_init_data_list[i];
|
||||
|
||||
#if WASM_ENABLE_REF_TYPES != 0
|
||||
@ -1404,6 +1402,16 @@ aot_call_function(WASMExecEnv *exec_env, AOTFunctionInstance *function,
|
||||
uint32 ext_ret_count = result_count > 1 ? result_count - 1 : 0;
|
||||
bool ret;
|
||||
|
||||
if (argc < func_type->param_cell_num) {
|
||||
char buf[128];
|
||||
snprintf(buf, sizeof(buf),
|
||||
"invalid argument count %u, must be no smaller than %u", argc,
|
||||
func_type->param_cell_num);
|
||||
aot_set_exception(module_inst, buf);
|
||||
return false;
|
||||
}
|
||||
argc = func_type->param_cell_num;
|
||||
|
||||
/* set thread handle and stack boundary */
|
||||
wasm_exec_env_set_thread_info(exec_env);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user