mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-07 09:17:29 +00:00
Fix assertion failure in cufa optimization with named args
Fixes oss-fuzz#30764.
This commit is contained in:
1 parent
8b9dd0a301
commit
c70220205e
2 files changed
+9
No files matched your search
@@ -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]);
|
||||
|
||||
Reference in new issue
Block a user