This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/27954] ICE on garbage in DATA statement



------- Comment #12 from jvdelisle at gcc dot gnu dot org  2006-10-20 03:24 -------
I believe this is a duplicate of PR18923.  What I am finding is that under some
error conditions, we end up with empty symbols.  When gfc resolve is executed
we are bumping into this arror because the sym->name is equal to '\0'.  With
this patch the call to gfc_get_default_type is avoided and we get a clean exit.
 This begs the question, should these empty symbols be left to begin with. 
This "fixes" both bugs.  I have found another bug, playing with variations on
the test case that gives a similar error in gfc_typename.

Index: symbol.c
===================================================================
--- symbol.c    (revision 117876)
+++ symbol.c    (working copy)
@@ -223,6 +223,9 @@ gfc_set_default_type (gfc_symbol * sym,

   if (sym->ts.type != BT_UNKNOWN)
     gfc_internal_error ("gfc_set_default_type(): symbol already has a type");
+
+  if (*sym->name == '\0')
+    return FAILURE;

   ts = gfc_get_default_type (sym, ns);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27954


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]