Skip to content

Commit d948c74

Browse files
committed
removes workarounds for #11883
1 parent 36b86e7 commit d948c74

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

ext/zend_test/test.c

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -985,56 +985,6 @@ static void register_dynamic_function_entries(void) {
985985
zend_register_functions(NULL, dynamic_function_entries, NULL, MODULE_PERSISTENT);
986986
}
987987

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-
1038988
PHP_MINIT_FUNCTION(zend_test)
1039989
{
1040990
register_dynamic_function_entries();
@@ -1111,9 +1061,6 @@ PHP_MINIT_FUNCTION(zend_test)
11111061

11121062
PHP_MSHUTDOWN_FUNCTION(zend_test)
11131063
{
1114-
release_dynamic_function_entries();
1115-
release_ZendTestClass_dnf_property(type);
1116-
11171064
if (type != MODULE_TEMPORARY) {
11181065
UNREGISTER_INI_ENTRIES();
11191066
}

0 commit comments

Comments
 (0)