This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] patch for PR 16935--segfault from OPEN
- From: Steven Bosscher <stevenb at suse dot de>
- To: Bud Davis <bdavis at gcc dot gnu dot org>,"gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>,gfortran <fortran at gcc dot gnu dot org>
- Date: Fri, 13 Aug 2004 08:21:09 +0200
- Subject: Re: [gfortran] patch for PR 16935--segfault from OPEN
- Organization: SUSE Labs
- References: <1092362093.32695.11.camel@localhost.localdomain>
On Friday 13 August 2004 03:54, Bud Davis wrote:
> * io/open.c (st_open): use flags instead of the unit structure.
>
>
> Index: gcc/libgfortran/io/open.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/libgfortran/io/open.c,v
> retrieving revision 1.3
> diff -c -3 -p -r1.3 open.c
> *** gcc/libgfortran/io/open.c 15 May 2004 20:44:38 -0000 1.3
> --- gcc/libgfortran/io/open.c 13 Aug 2004 01:40:30 -0000
> *************** st_open (void)
> *** 507,513 ****
> generate_error (ERROR_BAD_OPTION, "Bad unit number in OPEN
> statement");
>
> if (flags.position != POSITION_UNSPECIFIED &&
> ! u->flags.access == ACCESS_DIRECT)
> generate_error (ERROR_BAD_OPTION,
> "Cannot use POSITION with direct access files");
>
> --- 507,513 ----
> generate_error (ERROR_BAD_OPTION, "Bad unit number in OPEN
> statement");
>
> if (flags.position != POSITION_UNSPECIFIED &&
> ! flags.access == ACCESS_DIRECT)
> generate_error (ERROR_BAD_OPTION,
> "Cannot use POSITION with direct access files");
The && should also go to the new line:
! if (flags.position != POSITION_UNSPECIFIED
! && flags.access == ACCESS_DIRECT)
generate_error (ERROR_BAD_OPTION,
"Cannot use POSITION with direct access files");
OK with that change.
Gr.
Steven