This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] patch for PR 16935--segfault from OPEN


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]