This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch fortran] PR 13919 - Runtime "internal error" in IO
- From: bud davis <bdavis9659 at comcast dot net>
- To: Bud Davis <bdavis9659 at comcast dot net>
- Cc: gcc-patches at gcc dot gnu dot org, gfortran <fortran at gcc dot gnu dot org>
- Date: Fri, 20 Feb 2004 19:14:05 -0600
- Subject: Re: [patch fortran] PR 13919 - Runtime "internal error" in IO
- References: <1077325456.4974.34.camel@localhost.localdomain>
Let's try this again :)
problem was a segfault with an empty input file, finish_list_read has to
have something to work with or the setjmp / longjmp has big problems.
Here is a testsuite file, read_eof.f90:
! pr 13919, segfault when file is empty
open(unit=8,file='/tmp/any_file')
read(8,*,end=1)i
1 continue
end
Works with this test as well as the code snippet included in the PR. no
additional regressions.
Tested i686 / linux
--bud davis
Index: gcc/libgfortran/io/transfer.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/io/Attic/transfer.c,v
retrieving revision 1.1.2.7
diff -c -3 -p -r1.1.2.7 transfer.c
*** gcc/libgfortran/io/transfer.c 7 Feb 2004 15:33:29 -0000
1.1.2.7
--- gcc/libgfortran/io/transfer.c 11 Feb 2004 02:01:46 -0000
*************** finalize_transfer (void)
*** 1306,1312 ****
if (current_unit == NULL)
return;
! if (ioparm.list_format && g.mode == READING)
finish_list_read ();
else
{
--- 1306,1312 ----
if (current_unit == NULL)
return;
! if (ioparm.list_format && g.mode == READING && current_unit->endfile
== NO_ENDFILE)
finish_list_read ();
else
{
Bud Davis wrote:
the segfault was caused by a
Index: gcc/libgfortran/io/transfer.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/io/Attic/transfer.c,v
retrieving revision 1.1.2.7
diff -c -3 -p -r1.1.2.7 transfer.c
*** gcc/libgfortran/io/transfer.c 7 Feb 2004 15:33:29 -0000 1.1.2.7
--- gcc/libgfortran/io/transfer.c 11 Feb 2004 02:01:46 -0000
*************** finalize_transfer (void)
*** 1306,1312 ****
if (current_unit == NULL)
return;
! if (ioparm.list_format && g.mode == READING)
finish_list_read ();
else
{
--- 1306,1312 ----
if (current_unit == NULL)
return;
! if (ioparm.list_format && g.mode == READING && current_unit->endfile
== NO_ENDFILE)
finish_list_read ();
else
{
--
C -------------------------------|
C Bud Davis |
C mailto:bdavis9659@comcast.net |--------------->>>>>>>>
C http:/f77.linksysnet.com |
C -------------------------------|