@@ -829,6 +829,17 @@ static bool logical_immediate_p(uint64_t value, uint32_t reg_size)
829
829
| SET_Z_TYPE_INFO REG0, IS_UNDEF, tmp_reg
830
830
|.endmacro
831
831
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
+
832
843
/* Floating-point comparison between register 'reg' and value from memory 'addr'.
833
844
* Note: the equivalent macros in JIT/x86 are SSE_AVX_OP and SSE_OP. */
834
845
|.macro DOUBLE_CMP, reg, addr, tmp_reg, fp_tmp_reg
@@ -2106,7 +2117,7 @@ static int zend_jit_undefined_function_stub(dasm_State **Dst)
2106
2117
static int zend_jit_negative_shift_stub(dasm_State **Dst)
2107
2118
{
2108
2119
|->negative_shift:
2109
- | UNDEF_OPLINE_RESULT TMP1w
2120
+ | UNDEF_OPLINE_RESULT_IF_USED TMP1w, TMP2w
2110
2121
| LOAD_ADDR CARG1, zend_ce_arithmetic_error
2111
2122
| LOAD_ADDR CARG2, "Bit shift by negative number"
2112
2123
| EXT_CALL zend_throw_error, REG0
@@ -2117,7 +2128,7 @@ static int zend_jit_negative_shift_stub(dasm_State **Dst)
2117
2128
static int zend_jit_mod_by_zero_stub(dasm_State **Dst)
2118
2129
{
2119
2130
|->mod_by_zero:
2120
- | UNDEF_OPLINE_RESULT TMP1w
2131
+ | UNDEF_OPLINE_RESULT_IF_USED TMP1w, TMP2w
2121
2132
| LOAD_ADDR CARG1, zend_ce_division_by_zero_error
2122
2133
| LOAD_ADDR CARG2, "Modulo by zero"
2123
2134
| EXT_CALL zend_throw_error, REG0
0 commit comments