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
This commit is contained in:
Brooks Moses 2007-01-04 17:30:37 +00:00 committed by Brooks Moses
parent 5f9a37a648
commit 3ab7b3def2
4 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2007-01-04 Brooks Moses <brooks.moses@codesourcery.com>
PR 30235
* interface.c (compare_actual_formal): check for
alternate returns when iterating over non-present
arguments.
2007-01-04 Brooks Moses <brooks.moses@codesourcery.com>
* invoke.texi: Update manpage copyright to include 2007.

View File

@ -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)

View File

@ -1,3 +1,8 @@
2006-01-04 Brooks Moses <brooks.moses@codesourcery.com>
PR 30235
* gfortran.dg/altreturn_2.f90: new test.
2007-01-04 Tom Tromey <tromey@redhat.com>
PR preprocessor/28165:

View File

@ -0,0 +1,8 @@
! { dg-do compile }
program altreturn_2
call foo() ! { dg-error "Missing alternate return" }
contains
subroutine foo(*)
return
end subroutine
end program