mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix leak of backed_enum_table with preloading
This commit is contained in:
parent
912c22cca0
commit
d9e1871c85
2 changed files with 7 additions and 0 deletions
|
@ -187,6 +187,7 @@ void zend_enum_add_interfaces(zend_class_entry *ce)
|
|||
zend_result zend_enum_build_backed_enum_table(zend_class_entry *ce)
|
||||
{
|
||||
ZEND_ASSERT(ce->ce_flags & ZEND_ACC_ENUM);
|
||||
ZEND_ASSERT(!(ce->ce_flags & ZEND_ACC_IMMUTABLE));
|
||||
ZEND_ASSERT(ce->type == ZEND_USER_CLASS);
|
||||
|
||||
uint32_t backing_type = ce->enum_backing_type;
|
||||
|
|
|
@ -346,6 +346,12 @@ ZEND_API void zend_shutdown_executor_values(bool fast_shutdown)
|
|||
}
|
||||
}
|
||||
|
||||
if (ce->type == ZEND_USER_CLASS && ce->backed_enum_table) {
|
||||
ZEND_ASSERT(!(ce->ce_flags & ZEND_ACC_IMMUTABLE));
|
||||
zend_hash_release(ce->backed_enum_table);
|
||||
ce->backed_enum_table = NULL;
|
||||
}
|
||||
|
||||
if (ce->ce_flags & ZEND_HAS_STATIC_IN_METHODS) {
|
||||
zend_op_array *op_array;
|
||||
ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, op_array) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue