Skip to content

Do not build unnecessary FCI or FCC structures #9955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions ext/standard/var.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,28 +764,13 @@ static inline bool php_var_serialize_class_name(smart_str *buf, zval *struc) /*

static HashTable* php_var_serialize_call_sleep(zend_object *obj, zend_function *fn) /* {{{ */
{
zend_result res;
zend_fcall_info fci;
zend_fcall_info_cache fci_cache;
zval retval;

fci.size = sizeof(fci);
fci.object = obj;
fci.retval = &retval;
fci.param_count = 0;
fci.params = NULL;
fci.named_params = NULL;
ZVAL_UNDEF(&fci.function_name);

fci_cache.function_handler = fn;
fci_cache.object = obj;
fci_cache.called_scope = obj->ce;

BG(serialize_lock)++;
res = zend_call_function(&fci, &fci_cache);
zend_call_known_instance_method(fn, obj, &retval, /* param_count */ 0, /* params */ NULL);
BG(serialize_lock)--;

if (res == FAILURE || Z_ISUNDEF(retval)) {
if (Z_ISUNDEF(retval) || EG(exception)) {
zval_ptr_dtor(&retval);
return NULL;
}
Expand Down