@@ -985,56 +985,6 @@ static void register_dynamic_function_entries(void) {
985
985
zend_register_functions (NULL , dynamic_function_entries , NULL , MODULE_PERSISTENT );
986
986
}
987
987
988
- // workaround for https://github.com/php/php-src/issues/11883
989
- static void release_internal_zend_type (zend_type * type ) {
990
- if (ZEND_TYPE_HAS_LIST (* type )) {
991
- zend_type * list_type , * sublist_type ;
992
- ZEND_TYPE_LIST_FOREACH (ZEND_TYPE_LIST (* type ), list_type ) {
993
- if (ZEND_TYPE_HAS_LIST (* list_type )) {
994
- ZEND_TYPE_LIST_FOREACH (ZEND_TYPE_LIST (* list_type ), sublist_type ) {
995
- if (ZEND_TYPE_HAS_NAME (* sublist_type )) {
996
- zend_string_release (ZEND_TYPE_NAME (* sublist_type ));
997
- }
998
- } ZEND_TYPE_LIST_FOREACH_END ();
999
- free (ZEND_TYPE_LIST (* list_type ));
1000
- } else if (ZEND_TYPE_HAS_NAME (* list_type )) {
1001
- zend_string_release (ZEND_TYPE_NAME (* list_type ));
1002
- }
1003
- } ZEND_TYPE_LIST_FOREACH_END ();
1004
- free (ZEND_TYPE_LIST (* type ));
1005
- } else if (ZEND_TYPE_HAS_NAME (* type )) {
1006
- zend_string_release (ZEND_TYPE_NAME (* type ));
1007
- }
1008
- // zero-out the type to avoid double-free on shutdown
1009
- memset (type , 0 , sizeof (zend_type ));
1010
- }
1011
-
1012
- // workaround for https://github.com/php/php-src/issues/11883
1013
- static void release_dynamic_function_entries (void ) {
1014
- const zend_function_entry * iter = dynamic_function_entries ;
1015
- while (iter -> fname ) {
1016
- zend_function * func = zend_hash_str_find_ptr (CG (function_table ), iter -> fname , strlen (iter -> fname ));
1017
- // add 1 for the return type
1018
- uint32_t num_args = func -> internal_function .num_args + 1 ;
1019
- // return type is at offset -1
1020
- zend_internal_arg_info * arg_info_start = func -> internal_function .arg_info - 1 ;
1021
- for (int i = 0 ; i < num_args ; i ++ ) {
1022
- zend_internal_arg_info * arg_info = arg_info_start + i ;
1023
- release_internal_zend_type (& arg_info -> type );
1024
- }
1025
- iter ++ ;
1026
- }
1027
- }
1028
-
1029
- // workaround for https://github.com/php/php-src/issues/11883
1030
- static void release_ZendTestClass_dnf_property (int module_type ) {
1031
- // zend_hash_str_find_bucket fails when the module is loaded with dl(), no idea why...
1032
- if (module_type == MODULE_PERSISTENT ) {
1033
- zend_property_info * prop = zend_hash_str_find_ptr (& zend_test_class -> properties_info , "dnfProperty" , sizeof ("dnfProperty" ) - 1 );
1034
- release_internal_zend_type (& prop -> type );
1035
- }
1036
- }
1037
-
1038
988
PHP_MINIT_FUNCTION (zend_test )
1039
989
{
1040
990
register_dynamic_function_entries ();
@@ -1111,9 +1061,6 @@ PHP_MINIT_FUNCTION(zend_test)
1111
1061
1112
1062
PHP_MSHUTDOWN_FUNCTION (zend_test )
1113
1063
{
1114
- release_dynamic_function_entries ();
1115
- release_ZendTestClass_dnf_property (type );
1116
-
1117
1064
if (type != MODULE_TEMPORARY ) {
1118
1065
UNREGISTER_INI_ENTRIES ();
1119
1066
}
0 commit comments