Skip to content

Commit 065d00f

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fix leak with cycle in static prop of internal class
2 parents f7c61c0 + ed31e04 commit 065d00f

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Zend/tests/bug78335_2.phpt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
Bug #78335: Static properties containing cycles report as leak (internal class variant)
3+
--FILE--
4+
<?php
5+
6+
$foo = [&$foo];
7+
_ZendTestClass::$_StaticProp = $foo;
8+
9+
?>
10+
===DONE===
11+
--EXPECT--
12+
===DONE===

Zend/zend_execute_API.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,6 @@ void shutdown_executor(void) /* {{{ */
292292
} ZEND_HASH_FOREACH_END();
293293
ZEND_HASH_REVERSE_FOREACH_VAL(EG(class_table), zv) {
294294
zend_class_entry *ce = Z_PTR_P(zv);
295-
if (ce->type == ZEND_INTERNAL_CLASS) {
296-
break;
297-
}
298295
if (ce->default_static_members_count) {
299296
zend_cleanup_internal_class_data(ce);
300297
}
@@ -395,8 +392,6 @@ void shutdown_executor(void) /* {{{ */
395392
} ZEND_HASH_FOREACH_END_DEL();
396393
}
397394

398-
zend_cleanup_internal_classes();
399-
400395
while (EG(symtable_cache_ptr) > EG(symtable_cache)) {
401396
EG(symtable_cache_ptr)--;
402397
zend_hash_destroy(*EG(symtable_cache_ptr));

0 commit comments

Comments
 (0)