com php-src: Reflection: Copy invoke function also in the variadic case: ext/reflection/php_reflection.c
| From: | Nikita Popov | Date: | Wed, 03 Oct 2018 08:48:42 +0000 |
| Subject: | com php-src: Reflection: Copy invoke function also in the variadic case: ext/reflection/php_reflection.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-103316@lists.php.net to get a copy of this message | ||
Commit: 945f315506538208705d370f39a6896371e48ebb
Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 3 Oct 2018 10:48:42 +0200
Parents: db80e0e2ad016cbff55cc6e1311b7ffe9ad7101e
Branches: PHP-7.1 PHP-7.2 PHP-7.3 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=945f315506538208705d370f39a6896371e48ebb
Log:
Reflection: Copy invoke function also in the variadic case
It doesn't matter how the parameters are provided, we always have
to copy the trampoline invoke function.
Changed paths:
M ext/reflection/php_reflection.c
Diff:
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index bd2d824..34082f0 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -3332,13 +3332,11 @@ static void reflection_method_invoke(INTERNAL_FUNCTION_PARAMETERS, int
variadic)
fcc.called_scope = intern->ce;
fcc.object = object ? Z_OBJ_P(object) : NULL;
- if (!variadic) {
- /*
- * Copy the zend_function when calling via handler (e.g. Closure::__invoke())
- */
- if ((mptr->internal_function.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
- fcc.function_handler = _copy_function(mptr);
- }
+ /*
+ * Copy the zend_function when calling via handler (e.g. Closure::__invoke())
+ */
+ if ((mptr->internal_function.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
+ fcc.function_handler = _copy_function(mptr);
}
result = zend_call_function(&fci, &fcc);