mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix assertion failure in cufa optimization with named args
Fixes oss-fuzz#30764.
This commit is contained in:
parent
8b9dd0a301
commit
c70220205e
2 changed files with 9 additions and 0 deletions
|
@ -0,0 +1,8 @@
|
|||
--TEST--
|
||||
call_user_func_array() + array_slice() + named arguments
|
||||
--FILE--
|
||||
<?php
|
||||
call_user_func_array('func', array_slice(array: $a, 1, 2));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use positional argument after named argument in %s on line %d
|
|
@ -3878,6 +3878,7 @@ zend_result zend_compile_func_cufa(znode *result, zend_ast_list *args, zend_stri
|
|||
zend_string *name = zend_resolve_function_name(orig_name, args->child[1]->child[0]->attr, &is_fully_qualified);
|
||||
|
||||
if (zend_string_equals_literal_ci(name, "array_slice")
|
||||
&& !zend_args_contain_unpack_or_named(list)
|
||||
&& list->children == 3
|
||||
&& list->child[1]->kind == ZEND_AST_ZVAL) {
|
||||
zval *zv = zend_ast_get_zval(list->child[1]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue