]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2019-06-16 Thomas Koenig <tkoenig@gcc.gnu.org>
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 16 Jun 2019 08:34:31 +0000 (08:34 +0000)
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 16 Jun 2019 08:34:31 +0000 (08:34 +0000)
    * dump_parse_tree (debug): Add verison for formal arglist.
    Do not crash when a gfc_expr is NULL.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272353 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/dump-parse-tree.c

index 921a6fca551eaf5e52d41b0a0a610902c61870d0..d30fa2e50a885e9857f993a9d1fa74b59bdcd76d 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       * dump_parse_tree (debug): Add verison for formal arglist.
+       Do not crash when a gfc_expr is NULL.
+
 2019-06-15  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        * decl.c (gfc_match_derived_decl): Dummy argument cannot be a derived
index 41b2c88265c18872241c3105c9d66837b8f5df4a..4cff8059b73af1cc6276ff8e4120d2b01f5b083e 100644 (file)
@@ -66,6 +66,19 @@ void debug (symbol_attribute *attr)
   dumpfile = tmp;
 }
 
+void debug (gfc_formal_arglist *formal)
+{
+  FILE *tmp = dumpfile;
+  dumpfile = stderr;
+  for (; formal; formal = formal->next)
+    {
+      fputc ('\n', dumpfile);
+      show_symbol (formal->sym);
+    }
+  fputc ('\n', dumpfile);
+  dumpfile = tmp;
+}
+
 void debug (symbol_attribute attr)
 {
   debug (&attr);
@@ -75,9 +88,15 @@ void debug (gfc_expr *e)
 {
   FILE *tmp = dumpfile;
   dumpfile = stderr;
-  show_expr (e);
-  fputc (' ', dumpfile);
-  show_typespec (&e->ts);
+  if (e != NULL)
+    {
+      show_expr (e);
+      fputc (' ', dumpfile);
+      show_typespec (&e->ts);
+    }
+  else
+    fputs ("() ", dumpfile);
+
   fputc ('\n', dumpfile);
   dumpfile = tmp;
 }