Skip to content

Commit 77ce253

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Disable ASSIGN + SEND_VAL fusion for cases when destroying of old value may throw an exception.
2 parents 90b843b + 11a7310 commit 77ce253

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
27572757
} else {
27582758
op2_def_addr = op2_addr;
27592759
}
2760+
op1_info = OP1_INFO();
27602761
if (opline->result_type == IS_UNUSED) {
27612762
res_addr = 0;
27622763
res_info = -1;
@@ -2768,7 +2769,8 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
27682769
&& (i + 1) <= end
27692770
&& (opline+1)->opcode == ZEND_SEND_VAL
27702771
&& (opline+1)->op1_type == IS_TMP_VAR
2771-
&& (opline+1)->op1.var == opline->result.var) {
2772+
&& (opline+1)->op1.var == opline->result.var
2773+
&& (!(op1_info & MAY_HAVE_DTOR) || !(op1_info & MAY_BE_RC1))) {
27722774
i++;
27732775
res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_RX, (opline+1)->result.var);
27742776
if (!zend_jit_reuse_ip(&dasm_state)) {
@@ -2777,7 +2779,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
27772779
}
27782780
}
27792781
if (!zend_jit_assign(&dasm_state, opline,
2780-
OP1_INFO(), OP1_REG_ADDR(),
2782+
op1_info, OP1_REG_ADDR(),
27812783
OP1_DEF_INFO(), OP1_DEF_REG_ADDR(),
27822784
OP2_INFO(), op2_addr, op2_def_addr,
27832785
res_info, res_addr,

0 commit comments

Comments
 (0)