From: David Malcolm Date: Thu, 1 Aug 2024 00:38:41 +0000 (-0400) Subject: diagnostics: handle logical locations with NULL name X-Git-Tag: basepoints/gcc-16~7086 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55982d1682921fdaf595c28f84f63d600558d150;p=thirdparty%2Fgcc.git diagnostics: handle logical locations with NULL name gcc/ChangeLog: * diagnostic-path.cc (thread_event_printer::print_swimlane_for_event_range): Gracefully handle logical_location::get_name_for_path_output returning null. Signed-off-by: David Malcolm --- diff --git a/gcc/diagnostic-path.cc b/gcc/diagnostic-path.cc index b497d89d059..37751843f9a 100644 --- a/gcc/diagnostic-path.cc +++ b/gcc/diagnostic-path.cc @@ -860,7 +860,8 @@ public: if (const logical_location *logical_loc = range->m_logical_loc) { label_text name (logical_loc->get_name_for_path_output ()); - pp_printf (pp, "%qs: ", name.get ()); + if (name.get ()) + pp_printf (pp, "%qs: ", name.get ()); } if (range->m_start_idx == range->m_end_idx) pp_printf (pp, "event %i",