]> gcc.gnu.org Git - gcc.git/commitdiff
diagnostics: handle logical locations with NULL name
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 1 Aug 2024 00:38:41 +0000 (20:38 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Thu, 1 Aug 2024 00:38:41 +0000 (20:38 -0400)
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 <dmalcolm@redhat.com>
gcc/diagnostic-path.cc

index b497d89d05948a7ebdb2a198df3eaf9d3c2c0448..37751843f9aeb008645c76d3a2438806a6663d3e 100644 (file)
@@ -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",
This page took 0.062793 seconds and 5 git commands to generate.