@@ -86,10 +86,17 @@ ZEND_API zend_bool zend_value_instanceof_static(zval *zv);
86
86
ZEND_API void ZEND_FASTCALL zend_ref_add_type_source (zend_property_info_source_list * source_list , zend_property_info * prop );
87
87
ZEND_API void ZEND_FASTCALL zend_ref_del_type_source (zend_property_info_source_list * source_list , zend_property_info * prop );
88
88
89
- ZEND_API zval * zend_assign_to_typed_ref (zval * variable_ptr , zval * value , zend_uchar value_type , zend_bool strict , zend_refcounted * ref );
89
+ ZEND_API zval * zend_assign_to_typed_ref (zval * variable_ptr , zval * value , zend_uchar value_type , zend_bool strict );
90
90
91
- static zend_always_inline void zend_copy_to_variable (zval * variable_ptr , zval * value , zend_uchar value_type , zend_refcounted * ref )
91
+ static zend_always_inline void zend_copy_to_variable (zval * variable_ptr , zval * value , zend_uchar value_type )
92
92
{
93
+ zend_refcounted * ref = NULL ;
94
+
95
+ if (ZEND_CONST_COND (value_type & (IS_VAR |IS_CV ), 1 ) && Z_ISREF_P (value )) {
96
+ ref = Z_COUNTED_P (value );
97
+ value = Z_REFVAL_P (value );
98
+ }
99
+
93
100
ZVAL_COPY_VALUE (variable_ptr , value );
94
101
if (ZEND_CONST_COND (value_type == IS_CONST , 0 )) {
95
102
if (UNEXPECTED (Z_OPT_REFCOUNTED_P (variable_ptr ))) {
@@ -110,20 +117,13 @@ static zend_always_inline void zend_copy_to_variable(zval *variable_ptr, zval *v
110
117
111
118
static zend_always_inline zval * zend_assign_to_variable (zval * variable_ptr , zval * value , zend_uchar value_type , zend_bool strict )
112
119
{
113
- zend_refcounted * ref = NULL ;
114
-
115
- if (ZEND_CONST_COND (value_type & (IS_VAR |IS_CV ), 1 ) && Z_ISREF_P (value )) {
116
- ref = Z_COUNTED_P (value );
117
- value = Z_REFVAL_P (value );
118
- }
119
-
120
120
do {
121
121
if (UNEXPECTED (Z_REFCOUNTED_P (variable_ptr ))) {
122
122
zend_refcounted * garbage ;
123
123
124
124
if (Z_ISREF_P (variable_ptr )) {
125
125
if (UNEXPECTED (ZEND_REF_HAS_TYPE_SOURCES (Z_REF_P (variable_ptr )))) {
126
- return zend_assign_to_typed_ref (variable_ptr , value , value_type , strict , ref );
126
+ return zend_assign_to_typed_ref (variable_ptr , value , value_type , strict );
127
127
}
128
128
129
129
variable_ptr = Z_REFVAL_P (variable_ptr );
@@ -132,7 +132,7 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
132
132
}
133
133
}
134
134
garbage = Z_COUNTED_P (variable_ptr );
135
- zend_copy_to_variable (variable_ptr , value , value_type , ref );
135
+ zend_copy_to_variable (variable_ptr , value , value_type );
136
136
if (GC_DELREF (garbage ) == 0 ) {
137
137
rc_dtor_func (garbage );
138
138
} else { /* we need to split */
@@ -145,7 +145,7 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
145
145
}
146
146
} while (0 );
147
147
148
- zend_copy_to_variable (variable_ptr , value , value_type , ref );
148
+ zend_copy_to_variable (variable_ptr , value , value_type );
149
149
return variable_ptr ;
150
150
}
151
151
0 commit comments