]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sanopt: Avoid crash on anonymous parameter [PR93436]
authorMarek Polacek <polacek@redhat.com>
Thu, 5 Mar 2020 00:02:22 +0000 (19:02 -0500)
committerMarek Polacek <polacek@redhat.com>
Thu, 5 Mar 2020 00:02:22 +0000 (19:02 -0500)
            PR sanitizer/93436
            * sanopt.c (sanitize_rewrite_addressable_params): Avoid crash on
            null DECL_NAME.

gcc/ChangeLog
gcc/sanopt.c

index 640d64180f8ac40c09df63817be08ad1bbcecceb..e73e1d0fb2012a213704ae23cde19313f76beb41 100644 (file)
@@ -1,3 +1,12 @@
+2020-03-04  Marek Polacek  <polacek@redhat.com>
+
+       Backport from mainline
+       2020-01-26  Marek Polacek  <polacek@redhat.com>
+
+       PR sanitizer/93436
+       * sanopt.c (sanitize_rewrite_addressable_params): Avoid crash on
+       null DECL_NAME.
+
 2020-03-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/94002
index 5cb98e1b50e4e1644072bd18d74797c3cac43c3f..159d720bc192cb2196afe403e1e2fe34e606a21e 100644 (file)
@@ -1170,9 +1170,12 @@ sanitize_rewrite_addressable_params (function *fun)
            continue;
 
          if (dump_file)
-           fprintf (dump_file,
-                    "Rewriting parameter whose address is taken: %s\n",
-                    IDENTIFIER_POINTER (DECL_NAME (arg)));
+           {
+             fprintf (dump_file,
+                      "Rewriting parameter whose address is taken: ");
+             print_generic_expr (dump_file, arg, dump_flags);
+             fputc ('\n', dump_file);
+           }
 
          SET_DECL_PT_UID (var, DECL_PT_UID (arg));