Skip to content

Commit b9e4807

Browse files
committed
Make sure fast_call_var is initialized properly
1 parent 249915f commit b9e4807

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Zend/zend_vm_def.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7595,9 +7595,10 @@ ZEND_VM_HANDLER(162, ZEND_FAST_CALL, ANY, ANY)
75957595
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
75967596
ZEND_VM_CONTINUE();
75977597
}
7598-
if (UNEXPECTED(Z_OBJ_P(fast_call) != NULL)) {
7598+
if (opline->extended_value == ZEND_FAST_CALL_FROM_FINALLY && UNEXPECTED(Z_OBJ_P(fast_call) != NULL)) {
75997599
fast_call->u2.lineno = (uint32_t)-1;
76007600
} else {
7601+
Z_OBJ_P(fast_call) = NULL;
76017602
/* set return address */
76027603
fast_call->u2.lineno = opline - EX(func)->op_array.opcodes;
76037604
}

Zend/zend_vm_execute.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1607,9 +1607,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OP
16071607
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
16081608
ZEND_VM_CONTINUE();
16091609
}
1610-
if (UNEXPECTED(Z_OBJ_P(fast_call) != NULL)) {
1610+
if (opline->extended_value == ZEND_FAST_CALL_FROM_FINALLY && UNEXPECTED(Z_OBJ_P(fast_call) != NULL)) {
16111611
fast_call->u2.lineno = (uint32_t)-1;
16121612
} else {
1613+
Z_OBJ_P(fast_call) = NULL;
16131614
/* set return address */
16141615
fast_call->u2.lineno = opline - EX(func)->op_array.opcodes;
16151616
}

0 commit comments

Comments
 (0)