diff mbox series

[pushed] diagnostics: handle logical locations with NULL name

Message ID 20240801005107.1003894-1-dmalcolm@redhat.com
State New
Headers show
Series [pushed] diagnostics: handle logical locations with NULL name | expand

Commit Message

David Malcolm Aug. 1, 2024, 12:51 a.m. UTC
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Successful run of analyzer integration tests on x86_64-pc-linux-gnu.
Pushed to trunk as r15-2467-g55982d1682921f.

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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

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",