Skip to content

Commit b683a7e

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Fallback to first line of function when ex->opline is NULL (#10003)
2 parents 334d108 + adc2382 commit b683a7e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Zend/zend_execute_API.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,10 @@ ZEND_API uint32_t zend_get_executed_lineno(void) /* {{{ */
638638
ex = ex->prev_execute_data;
639639
}
640640
if (ex) {
641+
if (!ex->opline) {
642+
/* Missing SAVE_OPLINE()? Falling back to first line of function */
643+
return ex->func->op_array.opcodes[0].lineno;
644+
}
641645
if (EG(exception) && ex->opline->opcode == ZEND_HANDLE_EXCEPTION &&
642646
ex->opline->lineno == 0 && EG(opline_before_exception)) {
643647
return EG(opline_before_exception)->lineno;

0 commit comments

Comments
 (0)