From: Nikita Popov Date: Mon, 21 Oct 2019 08:26:10 +0000 (+0200) Subject: Fix leak with cycle in static prop of internal class X-Git-Tag: php-7.4.0RC5~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed31e0413309286473c9f5a32614a9c6b4062d3e;p=php Fix leak with cycle in static prop of internal class More the cleanup of interned classes before the final GC run, just like it is done for user classes. --- diff --git a/Zend/tests/bug78335_2.phpt b/Zend/tests/bug78335_2.phpt new file mode 100644 index 0000000000..bc9e8f5f0c --- /dev/null +++ b/Zend/tests/bug78335_2.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #78335: Static properties containing cycles report as leak (internal class variant) +--FILE-- + +===DONE=== +--EXPECT-- +===DONE=== diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index c2ab453485..d9e0d0a8aa 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -294,9 +294,6 @@ void shutdown_executor(void) /* {{{ */ } ZEND_HASH_FOREACH_END(); ZEND_HASH_REVERSE_FOREACH_VAL(EG(class_table), zv) { zend_class_entry *ce = Z_PTR_P(zv); - if (ce->type == ZEND_INTERNAL_CLASS) { - break; - } if (ce->default_static_members_count) { zend_cleanup_internal_class_data(ce); } @@ -397,8 +394,6 @@ void shutdown_executor(void) /* {{{ */ } ZEND_HASH_FOREACH_END_DEL(); } - zend_cleanup_internal_classes(); - while (EG(symtable_cache_ptr) > EG(symtable_cache)) { EG(symtable_cache_ptr)--; zend_hash_destroy(*EG(symtable_cache_ptr));