@@ -86,10 +86,17 @@ ZEND_API zend_bool zend_value_instanceof_static(zval *zv);
8686ZEND_API void ZEND_FASTCALL zend_ref_add_type_source (zend_property_info_source_list * source_list , zend_property_info * prop );
8787ZEND_API void ZEND_FASTCALL zend_ref_del_type_source (zend_property_info_source_list * source_list , zend_property_info * prop );
8888
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 );
9090
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 )
9292{
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+
93100 ZVAL_COPY_VALUE (variable_ptr , value );
94101 if (ZEND_CONST_COND (value_type == IS_CONST , 0 )) {
95102 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
110117
111118static zend_always_inline zval * zend_assign_to_variable (zval * variable_ptr , zval * value , zend_uchar value_type , zend_bool strict )
112119{
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-
120120 do {
121121 if (UNEXPECTED (Z_REFCOUNTED_P (variable_ptr ))) {
122122 zend_refcounted * garbage ;
123123
124124 if (Z_ISREF_P (variable_ptr )) {
125125 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 );
127127 }
128128
129129 variable_ptr = Z_REFVAL_P (variable_ptr );
@@ -132,7 +132,7 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
132132 }
133133 }
134134 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 );
136136 if (GC_DELREF (garbage ) == 0 ) {
137137 rc_dtor_func (garbage );
138138 } else { /* we need to split */
@@ -145,7 +145,7 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
145145 }
146146 } while (0 );
147147
148- zend_copy_to_variable (variable_ptr , value , value_type , ref );
148+ zend_copy_to_variable (variable_ptr , value , value_type );
149149 return variable_ptr ;
150150}
151151
0 commit comments