mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-14 05:31:13 +00:00
Fix invalid use of jit_reg_is_const_val in fast-jit (#2718)
`jit_reg_is_const_val` only checks whether the register is a const register and the const value is stored in the register. Should use `jit_reg_is_const` instead in the front end. Reported in #2710.
This commit is contained in:
parent
caf805ece7
commit
e161205a27
|
@ -227,7 +227,7 @@ jit_compile_op_f32_compare(JitCompContext *cc, FloatCond cond)
|
||||||
POP_F32(rhs);
|
POP_F32(rhs);
|
||||||
POP_F32(lhs);
|
POP_F32(lhs);
|
||||||
|
|
||||||
if (jit_reg_is_const_val(lhs) && jit_reg_is_const_val(rhs)) {
|
if (jit_reg_is_const(lhs) && jit_reg_is_const(rhs)) {
|
||||||
float32 lvalue = jit_cc_get_const_F32(cc, lhs);
|
float32 lvalue = jit_cc_get_const_F32(cc, lhs);
|
||||||
float32 rvalue = jit_cc_get_const_F32(cc, rhs);
|
float32 rvalue = jit_cc_get_const_F32(cc, rhs);
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ jit_compile_op_f64_compare(JitCompContext *cc, FloatCond cond)
|
||||||
POP_F64(rhs);
|
POP_F64(rhs);
|
||||||
POP_F64(lhs);
|
POP_F64(lhs);
|
||||||
|
|
||||||
if (jit_reg_is_const_val(lhs) && jit_reg_is_const_val(rhs)) {
|
if (jit_reg_is_const(lhs) && jit_reg_is_const(rhs)) {
|
||||||
float64 lvalue = jit_cc_get_const_F64(cc, lhs);
|
float64 lvalue = jit_cc_get_const_F64(cc, lhs);
|
||||||
float64 rvalue = jit_cc_get_const_F64(cc, rhs);
|
float64 rvalue = jit_cc_get_const_F64(cc, rhs);
|
||||||
|
|
||||||
|
|
|
@ -808,7 +808,7 @@ jit_compile_op_block(JitCompContext *cc, uint8 **p_frame_ip,
|
||||||
else if (label_type == LABEL_TYPE_IF) {
|
else if (label_type == LABEL_TYPE_IF) {
|
||||||
POP_I32(value);
|
POP_I32(value);
|
||||||
|
|
||||||
if (!jit_reg_is_const_val(value)) {
|
if (!jit_reg_is_const(value)) {
|
||||||
/* Compare value is not constant, create condition br IR */
|
/* Compare value is not constant, create condition br IR */
|
||||||
|
|
||||||
/* Create entry block */
|
/* Create entry block */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user