Committed as obvious. 2018-05-24 Steven G. Kargl <ka...@gcc.gnu.org>
PR fortran/85780 * resolve.c (resolve_fl_procedure): Avoid NULL dereference. 2018-05-24 Steven G. Kargl <ka...@gcc.gnu.org> PR fortran/85780 * gfortran.dg/pr85780.f90: New test. -- Steve
Index: gcc/fortran/resolve.c =================================================================== --- gcc/fortran/resolve.c (revision 260696) +++ gcc/fortran/resolve.c (working copy) @@ -12503,7 +12503,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) while (curr_arg != NULL) { /* Skip implicitly typed dummy args here. */ - if (curr_arg->sym->attr.implicit_type == 0) + if (curr_arg->sym && curr_arg->sym->attr.implicit_type == 0) if (!gfc_verify_c_interop_param (curr_arg->sym)) /* If something is found to fail, record the fact so we can mark the symbol for the procedure as not being Index: gcc/testsuite/gfortran.dg/pr85780.f90 =================================================================== --- gcc/testsuite/gfortran.dg/pr85780.f90 (nonexistent) +++ gcc/testsuite/gfortran.dg/pr85780.f90 (working copy) @@ -0,0 +1,5 @@ +! { dg-do compile } +! { dg-options "-std=legacy" } +! PR fortran/85780 +subroutine s(*) bind(c) +end