[fuzzing] Use software bound-check during fuzzing (#4003)
* Update CMakeLists.txt of fuzzing - enable software bound-check - enable wasi - disable libc builtin and multiple modules * Fix off-by-one error in result offset calculation for function calls
This commit is contained in:
@ -1670,7 +1670,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
{
|
||||
uint32 ret_idx;
|
||||
WASMFuncType *func_type;
|
||||
uint32 off, ret_offset;
|
||||
int32 off;
|
||||
uint32 ret_offset;
|
||||
uint8 *ret_types;
|
||||
if (cur_func->is_import_func)
|
||||
func_type = cur_func->u.func_import->func_type;
|
||||
@ -1682,9 +1683,9 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|
||||
ret_offset = prev_frame->ret_offset;
|
||||
|
||||
for (ret_idx = 0,
|
||||
off = sizeof(int16) * (func_type->result_count - 1);
|
||||
off = (int32)sizeof(int16) * (func_type->result_count - 1);
|
||||
ret_idx < func_type->result_count;
|
||||
ret_idx++, off -= sizeof(int16)) {
|
||||
ret_idx++, off -= (int32)sizeof(int16)) {
|
||||
if (ret_types[ret_idx] == VALUE_TYPE_I64
|
||||
|| ret_types[ret_idx] == VALUE_TYPE_F64) {
|
||||
PUT_I64_TO_ADDR(prev_frame->lp + ret_offset,
|
||||
|
||||
Reference in New Issue
Block a user