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:
Wenyong Huang 2023-11-03 14:25:26 +08:00 committed by GitHub
parent caf805ece7
commit e161205a27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -227,7 +227,7 @@ jit_compile_op_f32_compare(JitCompContext *cc, FloatCond cond)
POP_F32(rhs);
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 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(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 rvalue = jit_cc_get_const_F64(cc, rhs);

View File

@ -808,7 +808,7 @@ jit_compile_op_block(JitCompContext *cc, uint8 **p_frame_ip,
else if (label_type == LABEL_TYPE_IF) {
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 */
/* Create entry block */