Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix may_have_extra_named_args flag for ZEND_AST_UNPACK #17534

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -3661,6 +3661,12 @@ static uint32_t zend_compile_args(
"Cannot use argument unpacking after named arguments");
}

/* Unpack may contain named arguments. */
may_have_undef = 1;
if (!fbc || (fbc->common.fn_flags & ZEND_ACC_VARIADIC)) {
*may_have_extra_named_args = 1;
}

uses_arg_unpack = 1;
fbc = NULL;

Expand All @@ -3669,11 +3675,6 @@ static uint32_t zend_compile_args(
opline->op2.num = arg_count;
opline->result.var = EX_NUM_TO_VAR(arg_count - 1);

/* Unpack may contain named arguments. */
may_have_undef = 1;
if (!fbc || (fbc->common.fn_flags & ZEND_ACC_VARIADIC)) {
*may_have_extra_named_args = 1;
}
continue;
}

Expand Down
Loading