mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-09 13:16:26 +00:00
Add more checks for Fast JIT (#1433)
Add more checks for Fast JIT to fix the issues reported by instrument test: - add check for the jit_value before pushing it into the stack - add check at the end of form_and_translate_func - add checks after each jit pass
This commit is contained in:
parent
c64186b704
commit
18774805cc
|
@ -64,7 +64,7 @@ apply_compiler_passes(JitCompContext *cc)
|
||||||
cc->cur_pass_no = p - jit_globals.passes;
|
cc->cur_pass_no = p - jit_globals.passes;
|
||||||
bh_assert(*p < COMPILER_PASS_NUM);
|
bh_assert(*p < COMPILER_PASS_NUM);
|
||||||
|
|
||||||
if (!compiler_passes[*p].run(cc)) {
|
if (!compiler_passes[*p].run(cc) || jit_get_last_error(cc)) {
|
||||||
LOG_VERBOSE("JIT: compilation failed at pass[%td] = %s\n",
|
LOG_VERBOSE("JIT: compilation failed at pass[%td] = %s\n",
|
||||||
p - jit_globals.passes, compiler_passes[*p].name);
|
p - jit_globals.passes, compiler_passes[*p].name);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -731,6 +731,9 @@ form_and_translate_func(JitCompContext *cc)
|
||||||
*(jit_annl_end_bcip(cc, cc->exit_label)) =
|
*(jit_annl_end_bcip(cc, cc->exit_label)) =
|
||||||
cc->cur_wasm_module->load_addr;
|
cc->cur_wasm_module->load_addr;
|
||||||
|
|
||||||
|
if (jit_get_last_error(cc)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -513,6 +513,8 @@ set_local_f64(JitFrame *frame, int n, JitReg val)
|
||||||
|
|
||||||
#define PUSH(jit_value, value_type) \
|
#define PUSH(jit_value, value_type) \
|
||||||
do { \
|
do { \
|
||||||
|
if (!jit_value) \
|
||||||
|
goto fail; \
|
||||||
if (!jit_cc_push_value(cc, value_type, jit_value)) \
|
if (!jit_cc_push_value(cc, value_type, jit_value)) \
|
||||||
goto fail; \
|
goto fail; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user