mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix leak of backed_enum_table with preloading
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user