diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2018-05-24 22:31:11 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2018-05-24 22:31:11 +0000 |
commit | 1072bff8143c56ae3de8d08d122f4960f9bdcdd2 (patch) | |
tree | 6d40ed415ca32a5a9b98cc16b1e96f077dcb69c9 /gcc/fortran/decl.c | |
parent | 8909fee2891ba084a2b8d317e864b3cf4c1e6b01 (diff) | |
download | gcc-1072bff8143c56ae3de8d08d122f4960f9bdcdd2.zip gcc-1072bff8143c56ae3de8d08d122f4960f9bdcdd2.tar.gz gcc-1072bff8143c56ae3de8d08d122f4960f9bdcdd2.tar.bz2 |
re PR fortran/85779 (ICE in gfc_typename, at fortran/misc.c:156)
2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85779
* decl.c (gfc_match_derived_decl): Fix NULL point dereference.
2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85779
* gfortran.dg/pr85779_1.f90: New test.
* gfortran.dg/pr85779_2.f90: Ditto.
* gfortran.dg/pr85779_3.f90: Ditto.
From-SVN: r260697
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 2f90330..bd343b2 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -9960,8 +9960,12 @@ gfc_match_derived_decl (void) if (!gensym->attr.generic && gensym->ts.type != BT_UNKNOWN) { - gfc_error ("Derived type name %qs at %C already has a basic type " - "of %s", gensym->name, gfc_typename (&gensym->ts)); + if (gensym->ts.u.derived) + gfc_error ("Derived type name %qs at %C already has a basic type " + "of %s", gensym->name, gfc_typename (&gensym->ts)); + else + gfc_error ("Derived type name %qs at %C already has a basic type", + gensym->name); return MATCH_ERROR; } |