Skip to content

Commit 1c276aa

Browse files
GirgiasTysonAndre
andauthored
Use zend_call_known_instance_method() instead of building FCI/FCC in serializer subroutine (#9955)
Co-authored-by: Tyson Andre <tyson.andre@uwaterloo.ca>
1 parent 9a250cc commit 1c276aa

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

ext/standard/var.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -764,28 +764,13 @@ static inline bool php_var_serialize_class_name(smart_str *buf, zval *struc) /*
764764

765765
static HashTable* php_var_serialize_call_sleep(zend_object *obj, zend_function *fn) /* {{{ */
766766
{
767-
zend_result res;
768-
zend_fcall_info fci;
769-
zend_fcall_info_cache fci_cache;
770767
zval retval;
771768

772-
fci.size = sizeof(fci);
773-
fci.object = obj;
774-
fci.retval = &retval;
775-
fci.param_count = 0;
776-
fci.params = NULL;
777-
fci.named_params = NULL;
778-
ZVAL_UNDEF(&fci.function_name);
779-
780-
fci_cache.function_handler = fn;
781-
fci_cache.object = obj;
782-
fci_cache.called_scope = obj->ce;
783-
784769
BG(serialize_lock)++;
785-
res = zend_call_function(&fci, &fci_cache);
770+
zend_call_known_instance_method(fn, obj, &retval, /* param_count */ 0, /* params */ NULL);
786771
BG(serialize_lock)--;
787772

788-
if (res == FAILURE || Z_ISUNDEF(retval)) {
773+
if (Z_ISUNDEF(retval) || EG(exception)) {
789774
zval_ptr_dtor(&retval);
790775
return NULL;
791776
}

0 commit comments

Comments
 (0)