From 3ab7b3def2c04c65ec4054bb4e540fb70b1012b0 Mon Sep 17 00:00:00 2001 From: Brooks Moses Date: Thu, 4 Jan 2007 17:30:37 +0000 Subject: re PR fortran/30235 ([4.1 only] missing alternate return argument with explicit interface causes segfault) fortran/ PR 30235 * interface.c (compare_actual_formal): check for alternate returns when iterating over non-present arguments. testsuite/ PR 30235 * gfortran.dg/altreturn_2.f90: new test. From-SVN: r120447 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/interface.c | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ced91a8..2333b82 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,12 @@ 2007-01-04 Brooks Moses + PR 30235 + * interface.c (compare_actual_formal): check for + alternate returns when iterating over non-present + arguments. + +2007-01-04 Brooks Moses + * invoke.texi: Update manpage copyright to include 2007. 2007-01-04 Brooks Moses diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index dd1ac69..7b0c423 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1455,6 +1455,13 @@ compare_actual_formal (gfc_actual_arglist ** ap, { if (new[i] != NULL) continue; + if (f->sym == NULL) + { + if (where) + gfc_error ("Missing alternate return spec in subroutine call at %L", + where); + return 0; + } if (!f->sym->attr.optional) { if (where) -- cgit v1.1