re PR libfortran/19451 (Read after a write with a read only file)
2005-01-22 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/19451 * io/transfer.c (finalize_transfer): Don't do anything if there is an error condition. * open_readonly_1.f90: New test. From-SVN: r94101
This commit is contained in:
parent
c2d8571d91
commit
0e69bba9fc
@ -1,3 +1,8 @@
|
||||
2005-01-22 Thomas Koenig <Thomas.Koenig@online.de>
|
||||
|
||||
PR libfortran/19451
|
||||
* open_readonly_1.f90: New test.
|
||||
|
||||
2005-01-22 Thomas Koenig <Thomas.Koenig@online.de>
|
||||
|
||||
PR libfortran/18982
|
||||
|
14
gcc/testsuite/gfortran.dg/open_readonly_1.f90
Normal file
14
gcc/testsuite/gfortran.dg/open_readonly_1.f90
Normal file
@ -0,0 +1,14 @@
|
||||
! { dg-do run }
|
||||
! PR19451
|
||||
! Writing to a non-empty readonly file caused a segfault.
|
||||
! We were still trying to write the EOR after an error ocurred
|
||||
program prog
|
||||
open (unit=10, file='PR19451.dat')
|
||||
write (10,*) "Hello World"
|
||||
close (10)
|
||||
open (unit=10, file='PR19451.dat', action="read")
|
||||
write (10,*,err=20) "Hello World"
|
||||
call abort()
|
||||
20 continue
|
||||
end program
|
||||
|
@ -1,3 +1,9 @@
|
||||
2005-01-22 Thomas Koenig <Thomas.Koenig@online.de>
|
||||
|
||||
PR libfortran/19451
|
||||
* io/transfer.c (finalize_transfer): Don't do anything if
|
||||
there is an error condition.
|
||||
|
||||
2005-01-22 David Edelsohn <edelsohn@gnu.org>
|
||||
|
||||
PR libgfortran/19052
|
||||
|
@ -1389,6 +1389,9 @@ next_record (int done)
|
||||
static void
|
||||
finalize_transfer (void)
|
||||
{
|
||||
if (ioparm.library_return != LIBRARY_OK)
|
||||
return;
|
||||
|
||||
if ((ionml != NULL) && (ioparm.namelist_name != NULL))
|
||||
{
|
||||
if (ioparm.namelist_read_mode)
|
||||
|
Loading…
Reference in New Issue
Block a user