| Submitter | Steve Kargl |
|---|---|
| Date | Oct. 30, 2011, 11:50 p.m. |
| Message ID | <20111030235000.GA40903@troutmask.apl.washington.edu> |
| Download | mbox | patch |
| Permalink | /patch/122694/ |
| State | New |
| Headers | show |
Comments
On 10/30/2011 07:50 PM, Steve Kargl wrote: > I've had this patch in my i386-*-freebsd and x86_64-*-freebsd > for more than a week. Several 'gmake check-gfortran' have > been run during that time without a regression. > > OK for trunk? > OK, thanks for patch. Jerry
Patch
Index: fortran/io.c =================================================================== --- fortran/io.c (revision 180687) +++ fortran/io.c (working copy) @@ -2295,6 +2295,12 @@ gfc_resolve_close (gfc_close *close) if (gfc_reference_st_label (close->err, ST_LABEL_TARGET) == FAILURE) return FAILURE; + if (close->unit == NULL) + { + gfc_error ("CLOSE statement at %C requires a UNIT number"); + return FAILURE; + } + if (close->unit->expr_type == EXPR_CONSTANT && close->unit->ts.type == BT_INTEGER && mpz_sgn (close->unit->value.integer) < 0) Index: testsuite/gfortran.dg/no_unit_error_2.f90 =================================================================== --- testsuite/gfortran.dg/no_unit_error_2.f90 (revision 0) +++ testsuite/gfortran.dg/no_unit_error_2.f90 (revision 0) @@ -0,0 +1,4 @@ +! { dg-do compile } +! PR fortran/50404 +close(iostat=i) ! { dg-error "requires a UNIT number" } +end