Add check for code section size, fix interp float operations (#1480)
And enable classic interpreter instead fast interpreter when llvm jit is enabled, so as to fix the issue that llvm jit cannot handle opcode drop_64/select_64.
This commit is contained in:
@ -3278,6 +3278,13 @@ load_from_sections(WASMModule *module, WASMSection *sections,
|
||||
error_buf_size)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (i == module->function_count - 1
|
||||
&& func->code + func->code_size != buf_code_end) {
|
||||
set_error_buf(error_buf, error_buf_size,
|
||||
"code section size mismatch");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!module->possible_memory_grow) {
|
||||
@ -7344,7 +7351,7 @@ re_scan:
|
||||
else if (is_64bit_type(*(loader_ctx->frame_ref - 1))) {
|
||||
loader_ctx->frame_ref -= 2;
|
||||
loader_ctx->stack_cell_num -= 2;
|
||||
#if (WASM_ENABLE_FAST_INTERP == 0) || (WASM_ENABLE_JIT != 0)
|
||||
#if WASM_ENABLE_FAST_INTERP == 0
|
||||
*(p - 1) = WASM_OP_DROP_64;
|
||||
#endif
|
||||
#if WASM_ENABLE_FAST_INTERP != 0
|
||||
@ -7406,7 +7413,7 @@ re_scan:
|
||||
break;
|
||||
case REF_I64_2:
|
||||
case REF_F64_2:
|
||||
#if (WASM_ENABLE_FAST_INTERP == 0) || (WASM_ENABLE_JIT != 0)
|
||||
#if WASM_ENABLE_FAST_INTERP == 0
|
||||
*(p - 1) = WASM_OP_SELECT_64;
|
||||
#endif
|
||||
#if WASM_ENABLE_FAST_INTERP != 0
|
||||
|
||||
Reference in New Issue
Block a user