From d9fb6f2b4f1321b059807ff6073156f07d9d376b Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Thu, 2 Jul 2020 20:41:51 +0200 Subject: PR fortran/93337 - ICE in gfc_dt_upper_string, at fortran/module.c:441 When declaring a polymorphic variable that is not a dummy, allocatable or pointer, an ICE occurred due to a NULL pointer dereference. Check for that situation and punt. gcc/fortran/ PR fortran/93337 * class.c (gfc_find_derived_vtab): Punt if name is not set. --- gcc/fortran/class.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/fortran') diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index 08705c7..d6847eb 100644 --- a/gcc/fortran/class.c +++ b/gcc/fortran/class.c @@ -2277,6 +2277,9 @@ gfc_find_derived_vtab (gfc_symbol *derived) if (!derived) return NULL; + if (!derived->name) + return NULL; + /* Find the gsymbol for the module of use associated derived types. */ if ((derived->attr.use_assoc || derived->attr.used_in_submodule) && !derived->attr.vtype && !derived->attr.is_class) -- cgit v1.1