re PR libfortran/24416 (Wrong reading following namelist reading)

2005-10-24  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/24416
	* libgfortran/io/list_read.c (namelist_read): Exit with call to
	free_saved () so that character strings do not accumulate.

2005-10-24  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/24416
	gfortran.dg/namelist_char_only.f90: New test.

From-SVN: r105862
This commit is contained in:
Paul Thomas 2005-10-24 20:20:40 +00:00
parent 83d890b9ba
commit 7ba18cea54
4 changed files with 46 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2005-10-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/24416
gfortran.dg/namelist_char_only.f90: New test.
2005-10-24 Asher Langton <langton2@llnl.gov>
PR fortran/17031

View File

@ -0,0 +1,29 @@
! { dg-do run }
! { dg-options "-O0" }
! Test patch for PR24416.f90 - a used to come back from the read with var
! prepended.
!
IMPLICIT NONE
CHARACTER(len=10) :: var = "hello"
character(len=10) :: a = ""
NAMELIST /inx/ var
OPEN(unit=11, status='scratch')
write (11, *) "&INX"
write (11, *) " var = 'goodbye'"
write (11, *) "&END"
rewind (11)
READ(11,NML=inx)
CLOSE(11)
OPEN(unit=11, status='scratch')
write (11, *) "alls_well"
rewind (11)
READ(11,*) a
CLOSE(11)
if (a /= "alls_well") call abort ()
END

View File

@ -1,9 +1,15 @@
2005-10-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/24416
* libgfortran/io/list_read.c (namelist_read): Exit with call to
free_saved () so that character strings do not accumulate.
2005-10-23 Jerry DeLisle <jvdelisle@verizon.net>
PR libgfortran/24489
* io/transfer.c (read_block): Change the order of execution to not read
past end-of-record.
(read_block_direct): Same change.
PR libgfortran/24489
* io/transfer.c (read_block): Change the order of execution to not read
past end-of-record.
(read_block_direct): Same change.
2005-10-23 Francois-Xavier Coudert <coudert@clipper.ens.fr>

View File

@ -2364,13 +2364,14 @@ find_nml_name:
}
}
free_saved ();
return;
/* All namelist error calls return from here */
nml_err_ret:
free_saved ();
generate_error (ERROR_READ_VALUE , nml_err_msg);
return;
}