Skip to content

Commit 7e3eb14

Browse files
committed
Fallback to first line of function when ex->opline is NULL
This can happen due to missing SAVE_OPLINE() in the VM
1 parent 4987e65 commit 7e3eb14

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
@@ -627,6 +627,10 @@ ZEND_API uint32_t zend_get_executed_lineno(void) /* {{{ */
627627
ex = ex->prev_execute_data;
628628
}
629629
if (ex) {
630+
if (!ex->opline) {
631+
/* Missing SAVE_OPLINE()? Falling back to first line of function */
632+
return ex->func->op_array.opcodes[0].lineno;
633+
}
630634
if (EG(exception) && ex->opline->opcode == ZEND_HANDLE_EXCEPTION &&
631635
ex->opline->lineno == 0 && EG(opline_before_exception)) {
632636
return EG(opline_before_exception)->lineno;

0 commit comments

Comments
 (0)