From 87559763153cbcaa43bb117333687a49ce32c890 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 16 Aug 2021 12:11:39 +0200 Subject: [PATCH] Fix arginfo/zpp consistency check for call_user_func from strict_types scope This was using the wrong strict_types information. In this case the call is performed with strict_types=0. --- .../tests/call_user_func_strict_arginfo_check.phpt | 14 ++++++++++++++ Zend/zend_execute_API.c | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 Zend/tests/call_user_func_strict_arginfo_check.phpt diff --git a/Zend/tests/call_user_func_strict_arginfo_check.phpt b/Zend/tests/call_user_func_strict_arginfo_check.phpt new file mode 100644 index 00000000000..1f21ee989dd --- /dev/null +++ b/Zend/tests/call_user_func_strict_arginfo_check.phpt @@ -0,0 +1,14 @@ +--TEST-- +Arginfo / zpp consistency check for call_user_func() in strict context +--FILE-- + +--EXPECT-- +int(0) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index ed8fc2cef32..f475aa164a5 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -886,12 +886,12 @@ cleanup_args: EG(jit_trace_num) = orig_jit_trace_num; } else { ZEND_ASSERT(func->type == ZEND_INTERNAL_FUNCTION); -#if ZEND_DEBUG - bool should_throw = zend_internal_call_should_throw(func, call); -#endif ZVAL_NULL(fci->retval); call->prev_execute_data = EG(current_execute_data); EG(current_execute_data) = call; +#if ZEND_DEBUG + bool should_throw = zend_internal_call_should_throw(func, call); +#endif if (EXPECTED(zend_execute_internal == NULL)) { /* saves one function call if zend_execute_internal is not used */ func->internal_function.handler(call, fci->retval);