Skip to content

Commit ac12cc8

Browse files
committed
Fixed dl() function. It failed in DEBUG build without opcache because of assert during string interning.
1 parent f0ccd9f commit ac12cc8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Zend/zend_API.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,28 +2051,28 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /
20512051
}
20522052

20532053
name_len = strlen(module->name);
2054-
lcname = zend_string_alloc(name_len, 1);
2054+
lcname = zend_string_alloc(name_len, module->type == MODULE_PERSISTENT);
20552055
zend_str_tolower_copy(ZSTR_VAL(lcname), module->name, name_len);
20562056

20572057
lcname = zend_new_interned_string(lcname);
20582058
if ((module_ptr = zend_hash_add_mem(&module_registry, lcname, module, sizeof(zend_module_entry))) == NULL) {
20592059
zend_error(E_CORE_WARNING, "Module '%s' already loaded", module->name);
2060-
zend_string_release_ex(lcname, 1);
2060+
zend_string_release(lcname);
20612061
return NULL;
20622062
}
20632063
module = module_ptr;
20642064
EG(current_module) = module;
20652065

20662066
if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type)==FAILURE) {
20672067
zend_hash_del(&module_registry, lcname);
2068-
zend_string_release_ex(lcname, 1);
2068+
zend_string_release(lcname);
20692069
EG(current_module) = NULL;
20702070
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name);
20712071
return NULL;
20722072
}
20732073

20742074
EG(current_module) = NULL;
2075-
zend_string_release_ex(lcname, 1);
2075+
zend_string_release(lcname);
20762076
return module;
20772077
}
20782078
/* }}} */

0 commit comments

Comments
 (0)