From: Nikita Popov Date: Mon, 9 Dec 2019 07:41:43 +0000 (+0100) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ded87a9ea0f12107031e6cac6c0299c1f87ff233;p=php Merge branch 'PHP-7.4' * PHP-7.4: Fixed bug #78904: Don't call any magic for uninitialized typed properties --- ded87a9ea0f12107031e6cac6c0299c1f87ff233 diff --cc Zend/zend_object_handlers.c index 3b0bec45a5,610b15c6aa..668a1ef9d3 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@@ -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)) {