mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Mark enums and static fake closures as not collectable
Closes GH-19866
This commit is contained in:
@@ -866,6 +866,9 @@ ZEND_API void zend_create_fake_closure(zval *res, zend_function *func, zend_clas
|
||||
|
||||
closure = (zend_closure *)Z_OBJ_P(res);
|
||||
closure->func.common.fn_flags |= ZEND_ACC_FAKE_CLOSURE;
|
||||
if (Z_TYPE(closure->this_ptr) != IS_OBJECT) {
|
||||
GC_ADD_FLAGS(&closure->std, GC_NOT_COLLECTABLE);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ ZEND_API zend_object_handlers zend_enum_object_handlers;
|
||||
zend_object *zend_enum_new(zval *result, zend_class_entry *ce, zend_string *case_name, zval *backing_value_zv)
|
||||
{
|
||||
zend_object *zobj = zend_objects_new(ce);
|
||||
GC_ADD_FLAGS(zobj, GC_NOT_COLLECTABLE);
|
||||
ZVAL_OBJ(result, zobj);
|
||||
|
||||
zval *zname = OBJ_PROP_NUM(zobj, 0);
|
||||
|
||||
Reference in New Issue
Block a user