Skip to content

Commit e3d0bc0

Browse files
committed
Fixed bug #80109
Skip over leading EXT_NOP, if it exists.
1 parent 8f56b7a commit e3d0bc0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.0.0RC1
44

5+
- Core:
6+
. Fixed bug #80109 (Cannot skip arguments when extended debug is enabled).
7+
(Nikita)
58

69
17 Sep 2020, PHP 8.0.0beta4
710

Zend/zend_execute.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -4452,15 +4452,16 @@ static void end_fake_frame(zend_execute_data *call, zend_execute_data *old_prev_
44524452
ZEND_API zend_result ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *call) {
44534453
zend_function *fbc = call->func;
44544454
if (fbc->type == ZEND_USER_FUNCTION) {
4455+
zend_op_array *op_array = &fbc->op_array;
44554456
uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
4457+
uint32_t opline_offset = op_array->opcodes[0].opcode == ZEND_EXT_NOP;
44564458
for (uint32_t i = 0; i < num_args; i++) {
44574459
zval *arg = ZEND_CALL_VAR_NUM(call, i);
44584460
if (!Z_ISUNDEF_P(arg)) {
44594461
continue;
44604462
}
44614463

4462-
zend_op_array *op_array = &fbc->op_array;
4463-
zend_op *opline = &op_array->opcodes[i];
4464+
zend_op *opline = &op_array->opcodes[i + opline_offset];
44644465
if (EXPECTED(opline->opcode == ZEND_RECV_INIT)) {
44654466
zval *default_value = RT_CONSTANT(opline, opline->op2);
44664467
if (Z_OPT_TYPE_P(default_value) == IS_CONSTANT_AST) {

0 commit comments

Comments
 (0)