Skip to content

Commit 24082d5

Browse files
committed
Fix result operand undef for ARM JIT as well
Same change as 6de8b08.
1 parent 0d8bcfe commit 24082d5

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,17 @@ static bool logical_immediate_p(uint64_t value, uint32_t reg_size)
829829
| SET_Z_TYPE_INFO REG0, IS_UNDEF, tmp_reg
830830
|.endmacro
831831

832+
|.macro UNDEF_OPLINE_RESULT_IF_USED, tmp_reg1, tmp_reg2
833+
| ldr REG0, EX->opline
834+
| ldrb tmp_reg1, OP:REG0->result_type
835+
| TST_32_WITH_CONST tmp_reg1, (IS_TMP_VAR|IS_VAR), tmp_reg2
836+
| beq >1
837+
| ldr REG0w, OP:REG0->result.var
838+
| add REG0, FP, REG0
839+
| SET_Z_TYPE_INFO REG0, IS_UNDEF, tmp_reg1
840+
|1:
841+
|.endmacro
842+
832843
/* Floating-point comparison between register 'reg' and value from memory 'addr'.
833844
* Note: the equivalent macros in JIT/x86 are SSE_AVX_OP and SSE_OP. */
834845
|.macro DOUBLE_CMP, reg, addr, tmp_reg, fp_tmp_reg
@@ -2106,7 +2117,7 @@ static int zend_jit_undefined_function_stub(dasm_State **Dst)
21062117
static int zend_jit_negative_shift_stub(dasm_State **Dst)
21072118
{
21082119
|->negative_shift:
2109-
| UNDEF_OPLINE_RESULT TMP1w
2120+
| UNDEF_OPLINE_RESULT_IF_USED TMP1w, TMP2w
21102121
| LOAD_ADDR CARG1, zend_ce_arithmetic_error
21112122
| LOAD_ADDR CARG2, "Bit shift by negative number"
21122123
| EXT_CALL zend_throw_error, REG0
@@ -2117,7 +2128,7 @@ static int zend_jit_negative_shift_stub(dasm_State **Dst)
21172128
static int zend_jit_mod_by_zero_stub(dasm_State **Dst)
21182129
{
21192130
|->mod_by_zero:
2120-
| UNDEF_OPLINE_RESULT TMP1w
2131+
| UNDEF_OPLINE_RESULT_IF_USED TMP1w, TMP2w
21212132
| LOAD_ADDR CARG1, zend_ce_division_by_zero_error
21222133
| LOAD_ADDR CARG2, "Modulo by zero"
21232134
| EXT_CALL zend_throw_error, REG0

0 commit comments

Comments
 (0)