Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r16-6179-g20f9b31a2642a3

gcc/analyzer/ChangeLog:
        * supergraph.cc (supernode::dump_dot): Escape filename.

Signed-off-by: David Malcolm <[email protected]>
---
 gcc/analyzer/supergraph.cc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/analyzer/supergraph.cc b/gcc/analyzer/supergraph.cc
index f75fab1356dbd..0e28d4d9b3497 100644
--- a/gcc/analyzer/supergraph.cc
+++ b/gcc/analyzer/supergraph.cc
@@ -847,8 +847,14 @@ supernode::dump_dot (graphviz_out *gv, const dump_args_t 
&args) const
 
          if ((exploc.file != prev_exploc.file)
              && exploc.file)
-           pp_printf (pp, "<TR><TD>%s:%i:</TD></TR>",
-                      exploc.file, exploc.line);
+           {
+             pp_string (pp, "<TR><TD>");
+             pp_flush (pp);
+             pp_printf (pp, "%s", exploc.file);
+             /* Escape, to handle cases like "<built-in>".  */
+             pp_write_text_as_html_like_dot_to_stream (pp);
+             pp_printf (pp, ":%i:</TD></TR>", exploc.line);
+           }
          if (exploc.line != prev_exploc.line)
            if (const diagnostics::char_span line
                = global_dc->get_file_cache ().get_source_line (exploc.file,
-- 
2.26.3

Reply via email to