This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

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


problem was a rather obvious typo that was not found until
the "position='REWIND'" open option was used. u is NULL
until later on when the unit is searched for. 

no additional regression i686/gnu/linux FC1.


--bud 



test suite file:

! pr16935
! segfault at run time on open statement
       program bug2
       implicit none
       open( 1 , file = "str_500.txt", position = "REWIND" )
       end

Change log:

2004-08-12 Bud Davis  <bdavis9659@comcast.net>
 
	* 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");
  







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