[Bug fortran/45797] ICE (segfault): Invalid read in gfc_use_derived
mikael at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Feb 18 21:57:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45797
Mikael Morin <mikael at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
CC| |mikael at gcc dot gnu.org
--- Comment #2 from Mikael Morin <mikael at gcc dot gnu.org> 2011-02-18 21:26:55 UTC ---
quick fix
diff --git a/symbol.c b/symbol.c
index 71aa518..ac274d6 100644
--- a/symbol.c
+++ b/symbol.c
@@ -1939,6 +1939,10 @@ gfc_use_derived (gfc_symbol *sym)
gfc_symtree *st;
int i;
+ /* Something went bad earlier, bail out. */
+ if (sym == NULL)
+ return NULL;
+
if (sym->components != NULL || sym->attr.zero_comp)
return sym; /* Already defined. */
More information about the Gcc-bugs
mailing list