]> granicus.if.org Git - php/commitdiff
Reflection: Copy invoke function also in the variadic case
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 3 Oct 2018 08:48:42 +0000 (10:48 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 3 Oct 2018 08:48:42 +0000 (10:48 +0200)
It doesn't matter how the parameters are provided, we always have
to copy the trampoline invoke function.

ext/reflection/php_reflection.c

index bd2d824c382509c3f7a10ccab970720bfa85578b..34082f04cd434975121e474da1c1d90322cec323 100644 (file)
@@ -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);