@@ -11523,6 +11523,32 @@ static int zend_jit_rope(zend_jit_ctx *jit, const zend_op *opline, uint32_t op2_
11523
11523
return 1;
11524
11524
}
11525
11525
11526
+ static int zend_jit_zval_copy_deref_reg(zend_jit_ctx *jit, zend_jit_addr res_addr, uint32_t res_info, zend_jit_addr val_addr, ir_ref type, ir_ref *values)
11527
+ {
11528
+ ir_ref if_type, val;
11529
+
11530
+ if (res_info == MAY_BE_LONG) {
11531
+ if_type = ir_IF(ir_EQ(type, ir_CONST_U32(IS_LONG)));
11532
+ ir_IF_TRUE(if_type);
11533
+ val = jit_ZVAL_ADDR(jit, val_addr);
11534
+ ir_END_PHI_list(*values, val);
11535
+ ir_IF_FALSE(if_type);
11536
+ val = ir_ADD_OFFSET(jit_Z_PTR(jit, val_addr), offsetof(zend_reference, val));
11537
+ ir_END_PHI_list(*values, val);
11538
+ } else if (res_info == MAY_BE_DOUBLE) {
11539
+ if_type = ir_IF(ir_EQ(type, ir_CONST_U32(IS_DOUBLE)));
11540
+ ir_IF_TRUE(if_type);
11541
+ val = jit_ZVAL_ADDR(jit, val_addr);
11542
+ ir_END_PHI_list(*values, val);
11543
+ ir_IF_FALSE(if_type);
11544
+ val = ir_ADD_OFFSET(jit_Z_PTR(jit, val_addr), offsetof(zend_reference, val));
11545
+ ir_END_PHI_list(*values, val);
11546
+ } else {
11547
+ ZEND_UNREACHABLE();
11548
+ }
11549
+ return 1;
11550
+ }
11551
+
11526
11552
static int zend_jit_zval_copy_deref(zend_jit_ctx *jit, zend_jit_addr res_addr, zend_jit_addr val_addr, ir_ref type)
11527
11553
{
11528
11554
ir_ref if_refcounted, if_reference, if_refcounted2, ptr, val2, ptr2, type2;
@@ -14253,9 +14279,16 @@ static int zend_jit_fetch_obj(zend_jit_ctx *jit,
14253
14279
}
14254
14280
ir_END_list(end_inputs);
14255
14281
} else {
14256
- if (((res_info & MAY_BE_GUARD) && JIT_G(current_frame) && prop_info)
14257
- || Z_MODE(res_addr) == IS_REG) {
14282
+ if ((res_info & MAY_BE_GUARD) && JIT_G(current_frame) && prop_info) {
14258
14283
ir_END_PHI_list(end_values, jit_ZVAL_ADDR(jit, prop_addr));
14284
+ } else if ((res_info & MAY_BE_GUARD) && Z_MODE(res_addr) == IS_REG) {
14285
+ ir_END_PHI_list(end_values, jit_ZVAL_ADDR(jit, prop_addr));
14286
+ } else if (Z_MODE(res_addr) == IS_REG) {
14287
+ prop_type_ref = jit_Z_TYPE_INFO(jit, prop_addr);
14288
+
14289
+ if (!zend_jit_zval_copy_deref_reg(jit, res_addr, res_info & ~MAY_BE_GUARD, prop_addr, prop_type_ref, &end_values)) {
14290
+ return 0;
14291
+ }
14259
14292
} else {
14260
14293
prop_type_ref = jit_Z_TYPE_INFO(jit, prop_addr);
14261
14294
0 commit comments