]> granicus.if.org Git - php/commitdiff
Remove checks for read_property retval being NULL
authorNikita Popov <nikic@php.net>
Thu, 1 Oct 2015 14:33:30 +0000 (16:33 +0200)
committerNikita Popov <nikic@php.net>
Thu, 1 Oct 2015 14:33:30 +0000 (16:33 +0200)
read_property uses &EG(uninitialized_zval) instead.

Zend/zend_execute.c

index c6c73490e5458c79f043aca36802bcaec60854fd..f88ccb1ea7021d6ba79b32619aad6134184c6704 100644 (file)
@@ -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)) {