Commit 1fb84d5b by Steven G. Kargl

re PR fortran/78814 (ICE in symbol_rank, at fortran/interface.c:1265)

2017-11-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78814
	* interface.c (symbol_rank): Check for NULL pointer.

2017-11-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/78814
	* gfortran.dg/interface_40.f90: New testcase.

From-SVN: r254604
parent f097ff23
2017-11-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78814
* interface.c (symbol_rank): Check for NULL pointer.
2017-11-08 Steven G. Kargl <kargl@kgcc.gnu.org> 2017-11-08 Steven G. Kargl <kargl@kgcc.gnu.org>
PR Fortran/82841 PR Fortran/82841
......
...@@ -1262,8 +1262,13 @@ generic_correspondence (gfc_formal_arglist *f1, gfc_formal_arglist *f2, ...@@ -1262,8 +1262,13 @@ generic_correspondence (gfc_formal_arglist *f1, gfc_formal_arglist *f2,
static int static int
symbol_rank (gfc_symbol *sym) symbol_rank (gfc_symbol *sym)
{ {
gfc_array_spec *as; gfc_array_spec *as = NULL;
as = (sym->ts.type == BT_CLASS) ? CLASS_DATA (sym)->as : sym->as;
if (sym->ts.type == BT_CLASS && CLASS_DATA (sym) && CLASS_DATA (sym)->as)
as = CLASS_DATA (sym)->as;
else
as = sym->as;
return as ? as->rank : 0; return as ? as->rank : 0;
} }
......
2017-11-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78814
* gfortran.dg/interface_40.f90: New testcase.
2017-11-09 Eric Botcazou <ebotcazou@adacore.com> 2017-11-09 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/controlled2.adb, gnat.dg/controlled4.adb, * gnat.dg/controlled2.adb, gnat.dg/controlled4.adb,
......
! { dg-do compile }
! PR fortran/78814
! Code contributed by Gerhard Steinmetz
program p
class(*) :: x ! { dg-error " must be dummy, allocatable or pointer" }
print *, f(x)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment