File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -566,8 +566,13 @@ static void auto_global_dtor(zval *zv) /* {{{ */
566
566
static void function_copy_ctor (zval * zv ) /* {{{ */
567
567
{
568
568
zend_function * old_func = Z_FUNC_P (zv );
569
- zend_function * func = pemalloc ( sizeof ( zend_internal_function ), 1 ) ;
569
+ zend_function * func ;
570
570
571
+ if (old_func -> type == ZEND_USER_FUNCTION ) {
572
+ ZEND_ASSERT (old_func -> op_array .fn_flags & ZEND_ACC_IMMUTABLE );
573
+ return ;
574
+ }
575
+ func = pemalloc (sizeof (zend_internal_function ), 1 );
571
576
Z_FUNC_P (zv ) = func ;
572
577
memcpy (func , old_func , sizeof (zend_internal_function ));
573
578
function_add_ref (func );
Original file line number Diff line number Diff line change @@ -362,7 +362,9 @@ void zend_class_add_ref(zval *zv)
362
362
{
363
363
zend_class_entry * ce = Z_PTR_P (zv );
364
364
365
- ce -> refcount ++ ;
365
+ if (!(ce -> ce_flags & ZEND_ACC_IMMUTABLE )) {
366
+ ce -> refcount ++ ;
367
+ }
366
368
}
367
369
368
370
ZEND_API void destroy_op_array (zend_op_array * op_array )
You can’t perform that action at this time.
0 commit comments