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
+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>
PR Fortran/82841
static int
symbol_rank (gfc_symbol *sym)
{
- gfc_array_spec *as;
- as = (sym->ts.type == BT_CLASS) ? CLASS_DATA (sym)->as : sym->as;
+ gfc_array_spec *as = NULL;
+
+ 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;
}
+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>
* gnat.dg/controlled2.adb, gnat.dg/controlled4.adb,
--- /dev/null
+! { 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
+