Skip to content

Commit 11a7310

Browse files
committed
Disable ASSIGN + SEND_VAL fusion for cases when destroying of old value may throw an exception.
1 parent db6e60e commit 11a7310

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
@@ -2709,6 +2709,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
27092709
} else {
27102710
op2_def_addr = op2_addr;
27112711
}
2712+
op1_info = OP1_INFO();
27122713
if (opline->result_type == IS_UNUSED) {
27132714
res_addr = 0;
27142715
res_info = -1;
@@ -2720,7 +2721,8 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
27202721
&& (i + 1) <= end
27212722
&& (opline+1)->opcode == ZEND_SEND_VAL
27222723
&& (opline+1)->op1_type == IS_TMP_VAR
2723-
&& (opline+1)->op1.var == opline->result.var) {
2724+
&& (opline+1)->op1.var == opline->result.var
2725+
&& (!(op1_info & MAY_HAVE_DTOR) || !(op1_info & MAY_BE_RC1))) {
27242726
i++;
27252727
res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_RX, (opline+1)->result.var);
27262728
if (!zend_jit_reuse_ip(&dasm_state)) {
@@ -2729,7 +2731,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
27292731
}
27302732
}
27312733
if (!zend_jit_assign(&dasm_state, opline,
2732-
OP1_INFO(), OP1_REG_ADDR(),
2734+
op1_info, OP1_REG_ADDR(),
27332735
OP1_DEF_INFO(), OP1_DEF_REG_ADDR(),
27342736
OP2_INFO(), op2_addr, op2_def_addr,
27352737
res_info, res_addr,

0 commit comments

Comments
 (0)