File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 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) /* {{{ */
566566static void function_copy_ctor (zval * zv ) /* {{{ */
567567{
568568 zend_function * old_func = Z_FUNC_P (zv );
569- zend_function * func = pemalloc ( sizeof ( zend_internal_function ), 1 ) ;
569+ zend_function * func ;
570570
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 );
571576 Z_FUNC_P (zv ) = func ;
572577 memcpy (func , old_func , sizeof (zend_internal_function ));
573578 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)
362362{
363363 zend_class_entry * ce = Z_PTR_P (zv );
364364
365- ce -> refcount ++ ;
365+ if (!(ce -> ce_flags & ZEND_ACC_IMMUTABLE )) {
366+ ce -> refcount ++ ;
367+ }
366368}
367369
368370ZEND_API void destroy_op_array (zend_op_array * op_array )
You can’t perform that action at this time.
0 commit comments