]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.2' into PHP-7.3
authorDmitry Stogov <dmitry@zend.com>
Thu, 8 Aug 2019 07:05:59 +0000 (10:05 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 8 Aug 2019 07:05:59 +0000 (10:05 +0300)
* PHP-7.2:
  Fixed bug #78379 (Cast to object confuses GC, causes crash)

1  2 
NEWS
Zend/zend_object_handlers.c

diff --cc NEWS
Simple merge
index 7d200402a92c64440a2fa07cc9bad637fe5f6531,d0555c003104b61b686191d46e0f790489364773..266c257f7925b914579c6f2bd5210e47610f2d2e
@@@ -124,6 -138,11 +124,11 @@@ ZEND_API HashTable *zend_std_get_gc(zva
                if (zobj->properties) {
                        *table = NULL;
                        *n = 0;
 -                              GC_REFCOUNT(zobj->properties)--;
+                       if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)
+                        && EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) {
++                              GC_DELREF(zobj->properties);
+                               zobj->properties = zend_array_dup(zobj->properties);
+                       }
                        return zobj->properties;
                } else {
                        *table = zobj->properties_table;