mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
Avoid useless reference counting
This commit is contained in:
parent
826abe9d62
commit
0c0d43bd4e
@ -1030,11 +1030,8 @@ fetch_from_array:
|
|||||||
}
|
}
|
||||||
if (is_ref) {
|
if (is_ref) {
|
||||||
ZVAL_MAKE_REF(retval);
|
ZVAL_MAKE_REF(retval);
|
||||||
Z_ADDREF_P(retval);
|
|
||||||
ZVAL_REF(result, Z_REF_P(retval));
|
|
||||||
} else {
|
|
||||||
ZVAL_INDIRECT(result, retval);
|
|
||||||
}
|
}
|
||||||
|
ZVAL_INDIRECT(result, retval);
|
||||||
} else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) {
|
} else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) {
|
||||||
zend_long offset;
|
zend_long offset;
|
||||||
|
|
||||||
@ -1121,11 +1118,8 @@ convert_to_array:
|
|||||||
if (result != retval) {
|
if (result != retval) {
|
||||||
if (is_ref) {
|
if (is_ref) {
|
||||||
ZVAL_MAKE_REF(retval);
|
ZVAL_MAKE_REF(retval);
|
||||||
Z_ADDREF_P(retval);
|
|
||||||
ZVAL_REF(result, Z_REF_P(retval));
|
|
||||||
} else {
|
|
||||||
ZVAL_INDIRECT(result, retval);
|
|
||||||
}
|
}
|
||||||
|
ZVAL_INDIRECT(result, retval);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ZVAL_INDIRECT(result, &EG(error_zval));
|
ZVAL_INDIRECT(result, &EG(error_zval));
|
||||||
@ -1304,11 +1298,8 @@ static void zend_fetch_property_address(zval *result, zval *container_ptr, zval
|
|||||||
if (ptr != result) {
|
if (ptr != result) {
|
||||||
if (is_ref && ptr != &EG(uninitialized_zval)) {
|
if (is_ref && ptr != &EG(uninitialized_zval)) {
|
||||||
ZVAL_MAKE_REF(ptr);
|
ZVAL_MAKE_REF(ptr);
|
||||||
Z_ADDREF_P(ptr);
|
|
||||||
ZVAL_REF(result, Z_REF_P(ptr));
|
|
||||||
} else {
|
|
||||||
ZVAL_INDIRECT(result, ptr);
|
|
||||||
}
|
}
|
||||||
|
ZVAL_INDIRECT(result, ptr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
zend_error_noreturn(E_ERROR, "Cannot access undefined property for object with overloaded property access");
|
zend_error_noreturn(E_ERROR, "Cannot access undefined property for object with overloaded property access");
|
||||||
@ -1316,22 +1307,16 @@ static void zend_fetch_property_address(zval *result, zval *container_ptr, zval
|
|||||||
} else {
|
} else {
|
||||||
if (is_ref) {
|
if (is_ref) {
|
||||||
ZVAL_MAKE_REF(ptr);
|
ZVAL_MAKE_REF(ptr);
|
||||||
Z_ADDREF_P(ptr);
|
|
||||||
ZVAL_REF(result, Z_REF_P(ptr));
|
|
||||||
} else {
|
|
||||||
ZVAL_INDIRECT(result, ptr);
|
|
||||||
}
|
}
|
||||||
|
ZVAL_INDIRECT(result, ptr);
|
||||||
}
|
}
|
||||||
} else if (EXPECTED(Z_OBJ_HT_P(container)->read_property)) {
|
} else if (EXPECTED(Z_OBJ_HT_P(container)->read_property)) {
|
||||||
zval *ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result TSRMLS_CC);
|
zval *ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result TSRMLS_CC);
|
||||||
if (ptr != result) {
|
if (ptr != result) {
|
||||||
if (is_ref && ptr != &EG(uninitialized_zval)) {
|
if (is_ref && ptr != &EG(uninitialized_zval)) {
|
||||||
ZVAL_MAKE_REF(ptr);
|
ZVAL_MAKE_REF(ptr);
|
||||||
Z_ADDREF_P(ptr);
|
|
||||||
ZVAL_REF(result, Z_REF_P(ptr));
|
|
||||||
} else {
|
|
||||||
ZVAL_INDIRECT(result, ptr);
|
|
||||||
}
|
}
|
||||||
|
ZVAL_INDIRECT(result, ptr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
zend_error(E_WARNING, "This object doesn't support property references");
|
zend_error(E_WARNING, "This object doesn't support property references");
|
||||||
|
Loading…
Reference in New Issue
Block a user