Skip to content

Commit c56c19c

Browse files
committed
Fixed incorrect reference counting (we shouldn't skip ADDREF for IS_CV result)
1 parent 041cbec commit c56c19c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10434,7 +10434,8 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst, const zend_op *opline, cons
1043410434
&& (op2_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) {
1043510435
flags |= ZEND_JIT_EXIT_FREE_OP2;
1043610436
}
10437-
if ((res_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))
10437+
if ((opline->result_type & (IS_VAR|IS_TMP_VAR))
10438+
&& (res_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))
1043810439
&& (ssa_op+1)->op1_use == ssa_op->result_def
1043910440
&& zend_jit_may_avoid_refcounting(opline+1)) {
1044010441
res_info |= AVOID_REFCOUNTING;
@@ -11419,7 +11420,8 @@ static int zend_jit_fetch_obj(dasm_State **Dst, const zend_op *opline, const zen
1141911420

1142011421
| LOAD_ZVAL_ADDR r0, prop_addr
1142111422

11422-
if ((res_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))
11423+
if ((opline->result_type & (IS_VAR|IS_TMP_VAR))
11424+
&& (res_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))
1142311425
&& (ssa_op+1)->op1_use == ssa_op->result_def
1142411426
&& zend_jit_may_avoid_refcounting(opline+1)) {
1142511427
res_info |= AVOID_REFCOUNTING;

0 commit comments

Comments
 (0)