https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82866

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #4 from kargl at gcc dot gnu.org ---
(In reply to G. Steinmetz from comment #0)
> With invalid code similar to pr82586 :
> 
> 
> $ cat z1.f90
> module m
>    type t(*)
>    end type
> end
> 
> 
> $ /gfortran-8-20171105 -c z1.f90
> f951: internal compiler error: Segmentation fault
> 0xb60fdf crash_signal
>         ../../gcc/toplev.c:324
> 0x7056d8 resolve_fl_derived0
>         ../../gcc/fortran/resolve.c:14004
> 0x70579b resolve_fl_derived
>         ../../gcc/fortran/resolve.c:14075
> 0x70035f resolve_symbol
>         ../../gcc/fortran/resolve.c:14434
> 0x71ae0b do_traverse_symtree
>         ../../gcc/fortran/symbol.c:4157
> 0x70371a resolve_types
>         ../../gcc/fortran/resolve.c:16326
> 0x6ff04c gfc_resolve(gfc_namespace*)
>         ../../gcc/fortran/resolve.c:16440
> 0x6e8ee4 gfc_parse_file()
>         ../../gcc/fortran/parse.c:6232
> 0x72d3bf gfc_be_parse_file
>         ../../gcc/fortran/f95-lang.c:204

% svn diff resolve.c 
Index: resolve.c
===================================================================
--- resolve.c   (revision 254461)
+++ resolve.c   (working copy)
@@ -14001,13 +14001,19 @@ resolve_fl_derived0 (gfc_symbol *sym)
     {
       for (f = sym->formal; f; f = f->next)
        {
-         c = gfc_find_component (sym, f->sym->name, true, true, NULL);
-         if (c == NULL)
+         if (!f->sym)
            {
              gfc_error ("Parameterized type %qs does not have a component "
+                        "at %L", sym->name, &sym->declared_at);
+             return false;
+           }
+
+         if (!gfc_find_component (sym, f->sym->name, true, true, NULL))
+           {
+             gfc_error ("Parameterized type %qs does not have a component "
                         "corresponding to parameter %qs at %L", sym->name,
                         f->sym->name, &sym->declared_at);
-             break;
+             return false;
            }
        }
     }

Reply via email to