@@ -11865,7 +11865,7 @@ static int zend_jit_zval_copy_deref(dasm_State **Dst, zend_jit_addr res_addr, ze
11865
11865
return 1;
11866
11866
}
11867
11867
11868
- static zend_bool zend_jit_may_avoid_refcounting(const zend_op *opline)
11868
+ static zend_bool zend_jit_may_avoid_refcounting(const zend_op *opline, uint32_t op1_info )
11869
11869
{
11870
11870
switch (opline->opcode) {
11871
11871
case ZEND_FETCH_OBJ_FUNC_ARG:
@@ -11877,7 +11877,8 @@ static zend_bool zend_jit_may_avoid_refcounting(const zend_op *opline)
11877
11877
/* break missing intentionally */
11878
11878
case ZEND_FETCH_OBJ_R:
11879
11879
case ZEND_FETCH_OBJ_IS:
11880
- if (opline->op2_type == IS_CONST
11880
+ if ((op1_info & MAY_BE_OBJECT)
11881
+ && opline->op2_type == IS_CONST
11881
11882
&& Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_STRING
11882
11883
&& Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))[0] != '\0') {
11883
11884
return 1;
@@ -11956,7 +11957,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
11956
11957
&& (res_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))
11957
11958
&& (ssa_op+1)->op1_use == ssa_op->result_def
11958
11959
&& !(op2_info & ((MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF) - (MAY_BE_STRING|MAY_BE_LONG)))
11959
- && zend_jit_may_avoid_refcounting(opline+1)) {
11960
+ && zend_jit_may_avoid_refcounting(opline+1, res_info )) {
11960
11961
result_avoid_refcounting = 1;
11961
11962
ssa->var_info[ssa_op->result_def].avoid_refcounting = 1;
11962
11963
}
@@ -13225,7 +13226,7 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
13225
13226
&& !(flags & ZEND_JIT_EXIT_FREE_OP1)
13226
13227
&& (res_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))
13227
13228
&& (ssa_op+1)->op1_use == ssa_op->result_def
13228
- && zend_jit_may_avoid_refcounting(opline+1)) {
13229
+ && zend_jit_may_avoid_refcounting(opline+1, res_info )) {
13229
13230
result_avoid_refcounting = 1;
13230
13231
ssa->var_info[ssa_op->result_def].avoid_refcounting = 1;
13231
13232
}
0 commit comments