com php-src: Remove checks for read_property retval being NULL: Zend/zend_execute.c
| From: | Nikita Popov | Date: | Thu, 01 Oct 2015 14:33:30 +0000 |
| Subject: | com php-src: Remove checks for read_property retval being NULL: Zend/zend_execute.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89252@lists.php.net to get a copy of this message | ||
Commit: 8557e8323a33288dd75eaafc4fb26a295351698a
Author: Nikita Popov <nikic@php.net> Thu, 1 Oct 2015 16:33:30 +0200
Parents: c25e81ab7be3e40fa8ce029b2da084cc7f6fb8b8
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8557e8323a33288dd75eaafc4fb26a295351698a
Log:
Remove checks for read_property retval being NULL
read_property uses &EG(uninitialized_zval) instead.
Changed paths:
M Zend/zend_execute.c
Diff:
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index c6c7349..f88ccb1 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1451,8 +1451,8 @@ static zend_never_inline void zend_assign_op_overloaded_property(zval *object,
z
ZVAL_OBJ(&obj, Z_OBJ_P(object));
Z_ADDREF(obj);
- if (Z_OBJ_HT(obj)->read_property &&
- (z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv)) != NULL)
{
+ if (EXPECTED(Z_OBJ_HT(obj)->read_property)) {
+ z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv);
if (UNEXPECTED(EG(exception))) {
OBJ_RELEASE(Z_OBJ(obj));
return;
@@ -1964,8 +1964,8 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval
*c
if (EXPECTED(Z_OBJ_HT_P(container)->get_property_ptr_ptr)) {
zval *ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, type,
cache_slot);
if (NULL == ptr) {
- if (Z_OBJ_HT_P(container)->read_property &&
- (ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result))
!= NULL) {
+ if (EXPECTED(Z_OBJ_HT_P(container)->read_property)) {
+ ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result);
if (ptr != result) {
ZVAL_INDIRECT(result, ptr);
} else if (UNEXPECTED(Z_ISREF_P(ptr) && Z_REFCOUNT_P(ptr) == 1)) {