Skip to content

Commit 0b12db6

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Fix may_have_extra_named_args flag for ZEND_AST_UNPACK
2 parents 25543b4 + 0b3e637 commit 0b12db6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ PHP NEWS
1818
. Fixed potential OOB when checking for trailing spaces on Windows. (cmb)
1919
. Fixed bug GH-17408 (Assertion failure Zend/zend_exceptions.c).
2020
(nielsdos, ilutov)
21+
. Fix may_have_extra_named_args flag for ZEND_AST_UNPACK. (nielsdos)
2122

2223
- DOM:
2324
. Fixed bug GH-17397 (Assertion failure ext/dom/php_dom.c). (nielsdos)

Zend/zend_compile.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3753,6 +3753,12 @@ static uint32_t zend_compile_args(
37533753
"Cannot use argument unpacking after named arguments");
37543754
}
37553755

3756+
/* Unpack may contain named arguments. */
3757+
may_have_undef = 1;
3758+
if (!fbc || (fbc->common.fn_flags & ZEND_ACC_VARIADIC)) {
3759+
*may_have_extra_named_args = 1;
3760+
}
3761+
37563762
uses_arg_unpack = 1;
37573763
fbc = NULL;
37583764

@@ -3761,11 +3767,6 @@ static uint32_t zend_compile_args(
37613767
opline->op2.num = arg_count;
37623768
opline->result.var = EX_NUM_TO_VAR(arg_count - 1);
37633769

3764-
/* Unpack may contain named arguments. */
3765-
may_have_undef = 1;
3766-
if (!fbc || (fbc->common.fn_flags & ZEND_ACC_VARIADIC)) {
3767-
*may_have_extra_named_args = 1;
3768-
}
37693770
continue;
37703771
}
37713772

0 commit comments

Comments
 (0)