Handle backslash in pp_write_text_as_dot_label_to_stream
authorTom de Vries <tom@codesourcery.com>
Sun, 17 Apr 2016 05:23:15 +0000 (05:23 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Sun, 17 Apr 2016 05:23:15 +0000 (05:23 +0000)
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

gcc/ChangeLog
gcc/pretty-print.c

index 9216e7af4df4cf1a3ce2a8a3abdb56a8f71032ac..5dd1b098dac9be51450d6d660fee73239b165673 100644 (file)
@@ -1,3 +1,9 @@
+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
index c3a90a72752eea3f4591aa61f873d631dc768a39..8ac3d347f83f2537390ed580c9b6d10162a7ef22 100644 (file)
@@ -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;