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] |
I am having a difficult time with this bug. Its really in two parts. The first part which I submitted before and then withdrew I am attaching again. I would like to commit this first part by itself since it fixes the original test case for this bug and it is needed. I will also commit the test case for it.
BTW on pr25697 I have tracked it partly to differences between the small buffer (8192 bytes) and the large buffer logic of fd_alloc. Hope to look at it some more tonight.
PR libgfortran/25697 * io/transfer.c (us_read): Detect end of file condition from previous operations and bail out (no need to pre-position).
Attachment:
read_eof.f90
Description: application/extension-f90
Index: io/transfer.c =================================================================== *** io/transfer.c (revision 109491) --- io/transfer.c (working copy) *************** us_read (st_parameter_dt *dtp) *** 1205,1215 **** int n; gfc_offset i; n = sizeof (gfc_offset); p = salloc_r (dtp->u.p.current_unit->s, &n); if (n == 0) ! return; /* end of file */ if (p == NULL || n != sizeof (gfc_offset)) { --- 1220,1236 ---- int n; gfc_offset i; + if (dtp->u.p.current_unit->endfile == AT_ENDFILE) + return; + n = sizeof (gfc_offset); p = salloc_r (dtp->u.p.current_unit->s, &n); if (n == 0) ! { ! dtp->u.p.current_unit->endfile = AT_ENDFILE; ! return; /* end of file */ ! } if (p == NULL || n != sizeof (gfc_offset)) {
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |