Removed redundant refcount manipulations

This commit is contained in:
Dmitry Stogov 2008-02-18 12:11:47 +00:00
parent 2633dcab46
commit 4cf7073a84

View File

@ -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;