mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
ext/spl: use ZPP specifier that doesn't free trampoline for spl_autoload_unregister()
This commit is contained in:
@@ -485,11 +485,12 @@ PHP_FUNCTION(spl_autoload_unregister)
|
||||
zend_fcall_info_cache fcc;
|
||||
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_FUNC(fci, fcc)
|
||||
Z_PARAM_FUNC_NO_TRAMPOLINE_FREE(fci, fcc)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
|
||||
if (fcc.function_handler && zend_string_equals_literal(
|
||||
fcc.function_handler->common.function_name, "spl_autoload_call")) {
|
||||
if (zend_string_equals_literal(fcc.function_handler->common.function_name, "spl_autoload_call")) {
|
||||
/* Release trampoline */
|
||||
zend_release_fcall_info_cache(&fcc);
|
||||
php_error_docref(NULL, E_DEPRECATED,
|
||||
"Using spl_autoload_call() as a callback for spl_autoload_unregister() is deprecated,"
|
||||
" to remove all registered autoloaders, call spl_autoload_unregister()"
|
||||
@@ -504,13 +505,6 @@ PHP_FUNCTION(spl_autoload_unregister)
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
if (!fcc.function_handler) {
|
||||
/* Call trampoline has been cleared by zpp. Refetch it, because we want to deal
|
||||
* with it ourselves. It is important that it is not refetched on every call,
|
||||
* because calls may occur from different scopes. */
|
||||
zend_is_callable_ex(&fci.function_name, NULL, 0, NULL, &fcc, NULL);
|
||||
}
|
||||
|
||||
Bucket *p = spl_find_registered_function(&fcc);
|
||||
/* Release trampoline */
|
||||
zend_release_fcall_info_cache(&fcc);
|
||||
|
||||
Reference in New Issue
Block a user