@@ -5558,7 +5558,7 @@ static int zend_jit_assign_dim(dasm_State **Dst, const zend_op *opline, const ze
5558
5558
return 0;
5559
5559
}
5560
5560
} else {
5561
- uint32_t var_info = zend_array_element_type(op1_info, 0, 0);
5561
+ uint32_t var_info = zend_array_element_type(op1_info, opline->op1_type, 0, 0);
5562
5562
zend_jit_addr var_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FCARG1a, 0);
5563
5563
5564
5564
if (!zend_jit_fetch_dimension_address_inner(Dst, opline, BP_VAR_W, op1_info, op2_info, 8, 8, NULL, NULL)) {
@@ -5571,6 +5571,9 @@ static int zend_jit_assign_dim(dasm_State **Dst, const zend_op *opline, const ze
5571
5571
if (op1_info & (MAY_BE_ARRAY_OF_REF|MAY_BE_OBJECT)) {
5572
5572
var_info |= MAY_BE_REF;
5573
5573
}
5574
+ if (var_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
5575
+ var_info |= MAY_BE_RC1;
5576
+ }
5574
5577
| // value = zend_assign_to_variable(variable_ptr, value, OP_DATA_TYPE);
5575
5578
if (!zend_jit_assign_to_variable(Dst, opline, op_array, var_addr, var_info, -1, (opline+1)->op1_type, (opline+1)->op1, op3_addr, val_info, res_addr, 0)) {
5576
5579
return 0;
@@ -5756,7 +5759,7 @@ static int zend_jit_assign_dim_op(dasm_State **Dst, const zend_op *opline, const
5756
5759
5757
5760
if (op1_info & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_ARRAY)) {
5758
5761
uint32_t var_info;
5759
- uint32_t var_def_info = zend_array_element_type(op1_def_info, 1, 0);
5762
+ uint32_t var_def_info = zend_array_element_type(op1_def_info, opline->op1_type, 1, 0);
5760
5763
5761
5764
|6:
5762
5765
if (opline->op2_type == IS_UNUSED) {
@@ -5777,10 +5780,13 @@ static int zend_jit_assign_dim_op(dasm_State **Dst, const zend_op *opline, const
5777
5780
|.code
5778
5781
| mov FCARG1a, r0
5779
5782
} else {
5780
- var_info = zend_array_element_type(op1_info, 0, 0);
5783
+ var_info = zend_array_element_type(op1_info, opline->op1_type, 0, 0);
5781
5784
if (op1_info & (MAY_BE_ARRAY_OF_REF|MAY_BE_OBJECT)) {
5782
5785
var_info |= MAY_BE_REF;
5783
5786
}
5787
+ if (var_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
5788
+ var_info |= MAY_BE_RC1;
5789
+ }
5784
5790
5785
5791
if (!zend_jit_fetch_dimension_address_inner(Dst, opline, BP_VAR_RW, op1_info, op2_info, 8, 8, NULL, NULL)) {
5786
5792
return 0;
@@ -11132,7 +11138,8 @@ static int zend_jit_fetch_obj(dasm_State **Dst, const zend_op *opline, const zen
11132
11138
|9: // END
11133
11139
if (opline->op1_type != IS_UNUSED && !use_this && !op1_indirect) {
11134
11140
if (opline->op1_type == IS_VAR
11135
- && opline->opcode == ZEND_FETCH_OBJ_W) {
11141
+ && opline->opcode == ZEND_FETCH_OBJ_W
11142
+ && (op1_info & MAY_BE_RC1)) {
11136
11143
zend_jit_addr orig_op1_addr = OP1_ADDR();
11137
11144
11138
11145
| IF_NOT_ZVAL_REFCOUNTED orig_op1_addr, >1
0 commit comments