This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] |
PR libgfortran/27575 * io/transfer.c (read_block): Add check for end file condition. (read_block_direct): Add check for end file condition.
Index: io/transfer.c =================================================================== *** io/transfer.c (revision 113642) --- io/transfer.c (working copy) *************** read_block (st_parameter_dt *dtp, int *l *** 272,277 **** --- 272,284 ---- } } + if (dtp->u.p.current_unit->bytes_left == 0) + { + dtp->u.p.current_unit->endfile = AT_ENDFILE; + generate_error (&dtp->common, ERROR_END, NULL); + return; + } + *length = dtp->u.p.current_unit->bytes_left; } *************** read_block_direct (st_parameter_dt *dtp, *** 328,333 **** --- 335,347 ---- } } + if (dtp->u.p.current_unit->bytes_left == 0) + { + dtp->u.p.current_unit->endfile = AT_ENDFILE; + generate_error (&dtp->common, ERROR_END, NULL); + return; + } + *nbytes = dtp->u.p.current_unit->bytes_left; }
Attachment:
read_eof_4.f90
Description: application/extension-f90
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |