From: Dmitry Stogov Date: Thu, 8 Aug 2019 07:05:59 +0000 (+0300) Subject: Merge branch 'PHP-7.2' into PHP-7.3 X-Git-Tag: php-7.3.9RC1~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bff2743caf93332dd4a2ca658f50dc3c1d8cb144;p=php Merge branch 'PHP-7.2' into PHP-7.3 * PHP-7.2: Fixed bug #78379 (Cast to object confuses GC, causes crash) --- bff2743caf93332dd4a2ca658f50dc3c1d8cb144 diff --cc Zend/zend_object_handlers.c index 7d200402a9,d0555c0031..266c257f79 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@@ -124,6 -138,11 +124,11 @@@ ZEND_API HashTable *zend_std_get_gc(zva if (zobj->properties) { *table = NULL; *n = 0; + if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1) + && EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { - GC_REFCOUNT(zobj->properties)--; ++ GC_DELREF(zobj->properties); + zobj->properties = zend_array_dup(zobj->properties); + } return zobj->properties; } else { *table = zobj->properties_table;