Skip to content

Commit 20f9b31

Browse files
committed
analyzer: escape filenames in supergraph dump
gcc/analyzer/ChangeLog: * supergraph.cc (supernode::dump_dot): Escape filename. Signed-off-by: David Malcolm <[email protected]>
1 parent e50ec07 commit 20f9b31

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

gcc/analyzer/supergraph.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,14 @@ supernode::dump_dot (graphviz_out *gv, const dump_args_t &args) const
847847

848848
if ((exploc.file != prev_exploc.file)
849849
&& exploc.file)
850-
pp_printf (pp, "<TR><TD>%s:%i:</TD></TR>",
851-
exploc.file, exploc.line);
850+
{
851+
pp_string (pp, "<TR><TD>");
852+
pp_flush (pp);
853+
pp_printf (pp, "%s", exploc.file);
854+
/* Escape, to handle cases like "<built-in>". */
855+
pp_write_text_as_html_like_dot_to_stream (pp);
856+
pp_printf (pp, ":%i:</TD></TR>", exploc.line);
857+
}
852858
if (exploc.line != prev_exploc.line)
853859
if (const diagnostics::char_span line
854860
= global_dc->get_file_cache ().get_source_line (exploc.file,

0 commit comments

Comments
 (0)