From: Nikita Popov Date: Thu, 1 Oct 2015 14:33:30 +0000 (+0200) Subject: Remove checks for read_property retval being NULL X-Git-Tag: php-7.1.0alpha1~1055^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8557e8323a33288dd75eaafc4fb26a295351698a;p=php Remove checks for read_property retval being NULL read_property uses &EG(uninitialized_zval) instead. --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index c6c73490e5..f88ccb1ea7 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)) {