]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4'
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 9 Dec 2019 07:41:43 +0000 (08:41 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 9 Dec 2019 07:42:34 +0000 (08:42 +0100)
* PHP-7.4:
  Fixed bug #78904: Don't call any magic for uninitialized typed properties

1  2 
Zend/tests/type_declarations/typed_properties_040.phpt
Zend/tests/type_declarations/typed_properties_074.phpt
Zend/zend_object_handlers.c

index 3b0bec45a5f21e9e14cc11862b234044f86354ff,610b15c6aa68b2f0dca6b6a672544e3e5c4fcedb..668a1ef9d335ce8989e82bc06f922443c4733ce9
@@@ -1083,10 -1129,13 +1088,13 @@@ ZEND_API void zend_std_unset_property(z
                        if (zobj->properties) {
                                HT_FLAGS(zobj->properties) |= HASH_FLAG_HAS_EMPTY_IND;
                        }
 -                      goto exit;
 +                      return;
                }
-               /* Reset the IS_PROP_UNINIT flag, if it exists. */
-               Z_PROP_FLAG_P(slot) = 0;
+               if (UNEXPECTED(Z_PROP_FLAG_P(slot) == IS_PROP_UNINIT)) {
+                       /* Reset the IS_PROP_UNINIT flag, if it exists and bypass __unset(). */
+                       Z_PROP_FLAG_P(slot) = 0;
 -                      goto exit;
++                      return;
+               }
        } else if (EXPECTED(IS_DYNAMIC_PROPERTY_OFFSET(property_offset))
         && EXPECTED(zobj->properties != NULL)) {
                if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) {