@@ -3394,7 +3394,7 @@ static zend_always_inline int _zend_update_type_info(
3394
3394
break ;
3395
3395
case ZEND_FETCH_THIS :
3396
3396
UPDATE_SSA_OBJ_TYPE (op_array -> scope , 1 , ssa_op -> result_def );
3397
- UPDATE_SSA_TYPE (MAY_BE_RC1 | MAY_BE_RCN |MAY_BE_OBJECT , ssa_op -> result_def );
3397
+ UPDATE_SSA_TYPE (MAY_BE_RCN |MAY_BE_OBJECT , ssa_op -> result_def );
3398
3398
break ;
3399
3399
case ZEND_FETCH_OBJ_R :
3400
3400
case ZEND_FETCH_OBJ_IS :
@@ -3408,20 +3408,22 @@ static zend_always_inline int _zend_update_type_info(
3408
3408
tmp = zend_fetch_prop_type (script , prop_info , & ce );
3409
3409
if (opline -> result_type != IS_TMP_VAR ) {
3410
3410
tmp |= MAY_BE_REF | MAY_BE_INDIRECT ;
3411
- } else if (prop_info ) {
3412
- /* FETCH_OBJ_R/IS for plain property increments reference counter,
3413
- so it can't be 1 */
3414
- tmp &= ~MAY_BE_RC1 ;
3415
- } else {
3416
- zend_class_entry * ce = NULL ;
3417
-
3418
- if (opline -> op1_type == IS_UNUSED ) {
3419
- ce = op_array -> scope ;
3420
- } else if (ssa_op -> op1_use >= 0 && !ssa -> var_info [ssa_op -> op1_use ].is_instanceof ) {
3421
- ce = ssa -> var_info [ssa_op -> op1_use ].ce ;
3422
- }
3423
- if (ce && !ce -> create_object && !ce -> __get ) {
3411
+ } else if (!(opline -> op1_type & (IS_VAR |IS_TMP_VAR )) || !(t1 & MAY_BE_RC1 )) {
3412
+ if (prop_info ) {
3413
+ /* FETCH_OBJ_R/IS for plain property increments reference counter,
3414
+ so it can't be 1 */
3424
3415
tmp &= ~MAY_BE_RC1 ;
3416
+ } else {
3417
+ zend_class_entry * ce = NULL ;
3418
+
3419
+ if (opline -> op1_type == IS_UNUSED ) {
3420
+ ce = op_array -> scope ;
3421
+ } else if (ssa_op -> op1_use >= 0 && !ssa -> var_info [ssa_op -> op1_use ].is_instanceof ) {
3422
+ ce = ssa -> var_info [ssa_op -> op1_use ].ce ;
3423
+ }
3424
+ if (ce && !ce -> create_object && !ce -> __get ) {
3425
+ tmp &= ~MAY_BE_RC1 ;
3426
+ }
3425
3427
}
3426
3428
}
3427
3429
UPDATE_SSA_TYPE (tmp , ssa_op -> result_def );
0 commit comments