mirror of
https://github.com/php/php-src.git
synced 2024-11-27 20:03:40 +08:00
Merge branch 'PHP-8.1'
* PHP-8.1: Fix memory leaks
This commit is contained in:
commit
a44fb09620
13
Zend/tests/named_params/call_user_func_array_variadic.phpt
Normal file
13
Zend/tests/named_params/call_user_func_array_variadic.phpt
Normal file
@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
call_user_func_array() with extra named parameters
|
||||
--FILE--
|
||||
<?php
|
||||
$args = array("" => 1);
|
||||
call_user_func_array("array_multisort", $args);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught ArgumentCountError: array_multisort() expects at least 1 argument, 0 given in %scall_user_func_array_variadic.php:3
|
||||
Stack trace:
|
||||
#0 %scall_user_func_array_variadic.php(3): array_multisort(: 1)
|
||||
#1 {main}
|
||||
thrown in %scall_user_func_array_variadic.php on line 3
|
@ -3987,6 +3987,7 @@ static void zend_compile_init_user_func(zend_ast *name_ast, uint32_t num_args, z
|
||||
static zend_result zend_compile_func_cufa(znode *result, zend_ast_list *args, zend_string *lcname) /* {{{ */
|
||||
{
|
||||
znode arg_node;
|
||||
zend_op *opline;
|
||||
|
||||
if (args->children != 2) {
|
||||
return FAILURE;
|
||||
@ -4028,7 +4029,8 @@ static zend_result zend_compile_func_cufa(znode *result, zend_ast_list *args, ze
|
||||
zend_compile_expr(&arg_node, args->child[1]);
|
||||
zend_emit_op(NULL, ZEND_SEND_ARRAY, &arg_node, NULL);
|
||||
zend_emit_op(NULL, ZEND_CHECK_UNDEF_ARGS, NULL, NULL);
|
||||
zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL);
|
||||
opline = zend_emit_op(result, ZEND_DO_FCALL, NULL, NULL);
|
||||
opline->extended_value = ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS;
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user