summaryrefslogtreecommitdiff
path: root/Zend/zend_execute_API.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-06-25 18:45:59 +0200
committerNikita Popov <nikita.ppv@gmail.com>2017-06-25 18:45:59 +0200
commit035a27cbc63d87a6acc761ce51109bcf47f9c27b (patch)
tree5b27de452a44abcd1d3dc38fd931c3f0aa1ec696 /Zend/zend_execute_API.c
parentee8e75aab4eeb88dde05b98fa982bbee745819b2 (diff)
downloadphp-git-035a27cbc63d87a6acc761ce51109bcf47f9c27b.tar.gz
Only compute callback name in error cases
Mostly the callback name is only used to report an error. Try to avoid calculating it if no error occurred.
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r--Zend/zend_execute_API.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index fec7f73f57..ae0dd8f972 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -703,19 +703,18 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
}
if (!fci_cache || !fci_cache->initialized) {
- zend_string *callable_name;
char *error = NULL;
if (!fci_cache) {
fci_cache = &fci_cache_local;
}
- if (!zend_is_callable_ex(&fci->function_name, fci->object, IS_CALLABLE_CHECK_SILENT, &callable_name, fci_cache, &error)) {
+ if (!zend_is_callable_ex(&fci->function_name, fci->object, IS_CALLABLE_CHECK_SILENT, NULL, fci_cache, &error)) {
if (error) {
+ zend_string *callable_name
+ = zend_get_callable_name_ex(&fci->function_name, fci->object);
zend_error(E_WARNING, "Invalid callback %s, %s", ZSTR_VAL(callable_name), error);
efree(error);
- }
- if (callable_name) {
zend_string_release(callable_name);
}
if (EG(current_execute_data) == &dummy_execute_data) {
@@ -730,16 +729,12 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
zend_error(E_DEPRECATED, "%s", error);
efree(error);
if (UNEXPECTED(EG(exception))) {
- if (callable_name) {
- zend_string_release(callable_name);
- }
if (EG(current_execute_data) == &dummy_execute_data) {
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
}
return FAILURE;
}
}
- zend_string_release(callable_name);
}
func = fci_cache->function_handler;