From 1e63cfc5aebffba379441f0d205332fd8bbefbb6 Mon Sep 17 00:00:00 2001 From: Tim Stack Date: Thu, 11 Aug 2022 08:55:59 -0700 Subject: [PATCH] [lss] fix issue with crumbs --- src/base/intern_string.hh | 5 ++++- src/logfile_sub_source.cc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/base/intern_string.hh b/src/base/intern_string.hh index 42dbcfb5..5682d850 100644 --- a/src/base/intern_string.hh +++ b/src/base/intern_string.hh @@ -119,7 +119,10 @@ struct string_fragment { { } - bool is_valid() const { return this->sf_begin != -1; } + bool is_valid() const + { + return this->sf_begin != -1 && this->sf_begin <= this->sf_end; + } int length() const { return this->sf_end - this->sf_begin; } diff --git a/src/logfile_sub_source.cc b/src/logfile_sub_source.cc index 3f9e57bf..6598f78e 100644 --- a/src/logfile_sub_source.cc +++ b/src/logfile_sub_source.cc @@ -2180,9 +2180,9 @@ logfile_sub_source::text_crumbs_for_line(int line, logline_value_vector values; auto& sbr = values.lvv_sbr; - attr_line_t al(to_string(sbr)); lf->read_full_message(msg_start_iter, sbr); + attr_line_t al(to_string(sbr)); format->annotate(file_line_number, al.get_attrs(), values); auto opid_opt = get_string_attr(al.get_attrs(), logline::L_OPID);