mirror of
https://github.com/php/php-src.git
synced 2024-11-25 10:54:15 +08:00
Removed redundant refcount manipulations
This commit is contained in:
parent
2633dcab46
commit
4cf7073a84
@ -699,18 +699,12 @@ static inline zval* zend_assign_to_variable(zval **variable_ptr_ptr, zval *value
|
||||
if (variable_ptr != value) {
|
||||
zend_uint refcount = Z_REFCOUNT_P(variable_ptr);
|
||||
|
||||
if (!is_tmp_var) {
|
||||
Z_ADDREF_P(value);
|
||||
}
|
||||
garbage = *variable_ptr;
|
||||
*variable_ptr = *value;
|
||||
Z_SET_REFCOUNT_P(variable_ptr, refcount);
|
||||
Z_SET_ISREF_P(variable_ptr);
|
||||
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
|
||||
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
|
||||
if (!is_tmp_var) {
|
||||
Z_DELREF_P(value);
|
||||
}
|
||||
zendi_zval_dtor(garbage);
|
||||
return variable_ptr;
|
||||
}
|
||||
@ -738,16 +732,12 @@ static inline zval* zend_assign_to_variable(zval **variable_ptr_ptr, zval *value
|
||||
if (variable_ptr!=value) {
|
||||
zend_uint refcount = Z_REFCOUNT_P(variable_ptr);
|
||||
|
||||
if (!is_tmp_var) {
|
||||
Z_ADDREF_P(value);
|
||||
}
|
||||
garbage = *variable_ptr;
|
||||
*variable_ptr = *value;
|
||||
Z_SET_REFCOUNT_P(variable_ptr, refcount);
|
||||
Z_SET_ISREF_P(variable_ptr);
|
||||
if (!is_tmp_var) {
|
||||
zendi_zval_copy_ctor(*variable_ptr);
|
||||
Z_DELREF_P(value);
|
||||
}
|
||||
zendi_zval_dtor(garbage);
|
||||
return variable_ptr;
|
||||
|
Loading…
Reference in New Issue
Block a user