diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 8dfffb48060..3c29ac7dc60 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -638,6 +638,10 @@ ZEND_API uint32_t zend_get_executed_lineno(void) /* {{{ */ ex = ex->prev_execute_data; } if (ex) { + if (!ex->opline) { + /* Missing SAVE_OPLINE()? Falling back to first line of function */ + return ex->func->op_array.opcodes[0].lineno; + } if (EG(exception) && ex->opline->opcode == ZEND_HANDLE_EXCEPTION && ex->opline->lineno == 0 && EG(opline_before_exception)) { return EG(opline_before_exception)->lineno;