diff options
author | Tom de Vries <tom@codesourcery.com> | 2016-04-17 05:23:15 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2016-04-17 05:23:15 +0000 |
commit | b3de2446458bf8c61a8e54d6bd424bafe7ab479e (patch) | |
tree | 2f3e3991ba6487879f83959cbbe6fb87685ba97a | |
parent | 795391fb1d64fcab3b7c4002dd15029423420dfc (diff) | |
download | gcc-b3de2446458bf8c61a8e54d6bd424bafe7ab479e.zip gcc-b3de2446458bf8c61a8e54d6bd424bafe7ab479e.tar.gz gcc-b3de2446458bf8c61a8e54d6bd424bafe7ab479e.tar.bz2 |
Handle backslash in pp_write_text_as_dot_label_to_stream
2016-04-17 Tom de Vries <tom@codesourcery.com>
PR other/70433
* pretty-print.c (pp_write_text_as_dot_label_to_stream): Escape
backslash in label.
From-SVN: r235077
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/pretty-print.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9216e7a..5dd1b09 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2016-04-17 Tom de Vries <tom@codesourcery.com> + PR other/70433 + * pretty-print.c (pp_write_text_as_dot_label_to_stream): Escape + backslash in label. + +2016-04-17 Tom de Vries <tom@codesourcery.com> + * pretty-print.c (pp_write_text_as_dot_label_to_stream): Classify chars '{}<> ' as escape-for-record. diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c index c3a90a7..8ac3d34 100644 --- a/gcc/pretty-print.c +++ b/gcc/pretty-print.c @@ -182,6 +182,12 @@ pp_write_text_as_dot_label_to_stream (pretty_printer *pp, bool for_record) /* The following characters always have to be escaped for use in labels. */ + case '\\': + /* There is a bug in some (f.i. 2.36.0) versions of graphiz + ( http://www.graphviz.org/mantisbt/view.php?id=2524 ) related to + backslash as last char in label. Let's avoid triggering it. */ + gcc_assert (*(p + 1) != '\0'); + /* Fall through. */ case '"': escape_char = true; break; |