@@ -96,9 +96,7 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC)
96
96
if (Z_REFCOUNTED_P (z )) {
97
97
if (!Z_DELREF_P (z )) {
98
98
ZEND_ASSERT (z != & EG (uninitialized_zval ));
99
- GC_REMOVE_ZVAL_FROM_BUFFER (z );
100
99
zval_dtor (z );
101
- efree (z );
102
100
}
103
101
}
104
102
}
@@ -911,11 +909,10 @@ static inline zval* zend_assign_tmp_to_variable(zval *variable_ptr, zval *value
911
909
GC_ZVAL_CHECK_POSSIBLE_ROOT (variable_ptr );
912
910
ZVAL_COPY_VALUE (variable_ptr , value );
913
911
} else {
914
- zval garbage ;
912
+ zend_refcounted * garbage = Z_COUNTED_P ( variable_ptr ) ;
915
913
916
- ZVAL_COPY_VALUE (& garbage , variable_ptr );
917
914
ZVAL_COPY_VALUE (variable_ptr , value );
918
- _zval_dtor_func (& garbage ZEND_FILE_LINE_CC );
915
+ _zval_dtor_func (garbage ZEND_FILE_LINE_CC );
919
916
}
920
917
return variable_ptr ;
921
918
}
@@ -946,21 +943,20 @@ static inline zval* zend_assign_const_to_variable(zval *variable_ptr, zval *valu
946
943
zval_copy_ctor (variable_ptr );
947
944
}
948
945
} else {
949
- zval garbage ;
946
+ zend_refcounted * garbage = Z_COUNTED_P ( variable_ptr ) ;
950
947
951
- ZVAL_COPY_VALUE (& garbage , variable_ptr );
952
948
ZVAL_COPY_VALUE (variable_ptr , value );
953
949
if (Z_REFCOUNTED_P (value )) {
954
950
zval_copy_ctor (variable_ptr );
955
951
}
956
- _zval_dtor_func (& garbage ZEND_FILE_LINE_CC );
952
+ _zval_dtor_func (garbage ZEND_FILE_LINE_CC );
957
953
}
958
954
return variable_ptr ;
959
955
}
960
956
961
957
static inline zval * zend_assign_to_variable (zval * variable_ptr , zval * value TSRMLS_DC )
962
958
{
963
- zval garbage ;
959
+ zend_refcounted * garbage ;
964
960
int is_ref = 0 ;
965
961
966
962
if (EXPECTED (!Z_REFCOUNTED_P (variable_ptr ))) {
@@ -982,7 +978,7 @@ static inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value TSRM
982
978
Z_OBJ_HANDLER_P (variable_ptr , set )(variable_ptr , value TSRMLS_CC );
983
979
} else if (EXPECTED (variable_ptr != value )) {
984
980
if (Z_REFCOUNT_P (variable_ptr )== 1 ) {
985
- ZVAL_COPY_VALUE ( & garbage , variable_ptr );
981
+ garbage = Z_COUNTED_P ( variable_ptr );
986
982
if (EXPECTED (!Z_ISREF_P (value ))) {
987
983
if (!is_ref ) {
988
984
ZVAL_COPY (variable_ptr , value );
@@ -992,15 +988,13 @@ static inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value TSRM
992
988
} else {
993
989
if (Z_REFCOUNT_P (value ) == 1 ) {
994
990
//??? auto dereferencing
995
- zend_reference * ref = Z_REF_P (value );
996
- ZVAL_COPY_VALUE (value , Z_REFVAL_P (value ));
991
+ ZVAL_UNREF (value );
997
992
ZVAL_COPY (variable_ptr , value );
998
- efree (ref );
999
993
} else {
1000
994
ZVAL_DUP (variable_ptr , Z_REFVAL_P (value ));
1001
995
}
1002
996
}
1003
- _zval_dtor_func (& garbage ZEND_FILE_LINE_CC );
997
+ _zval_dtor_func (garbage ZEND_FILE_LINE_CC );
1004
998
} else { /* we need to split */
1005
999
Z_DELREF_P (variable_ptr );
1006
1000
GC_ZVAL_CHECK_POSSIBLE_ROOT (variable_ptr );
@@ -1015,10 +1009,8 @@ static inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value TSRM
1015
1009
assign_ref :
1016
1010
if (Z_REFCOUNT_P (value ) == 1 ) {
1017
1011
//??? auto dereferencing
1018
- zend_reference * ref = Z_REF_P (value );
1019
- ZVAL_COPY_VALUE (value , Z_REFVAL_P (value ));
1012
+ ZVAL_UNREF (value );
1020
1013
ZVAL_COPY (variable_ptr , value );
1021
- efree (ref );
1022
1014
} else {
1023
1015
ZVAL_DUP (variable_ptr , Z_REFVAL_P (value ));
1024
1016
}
0 commit comments