diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2017-05-17 20:33:20 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2017-05-17 20:33:20 +0000 |
commit | 7f72e40263afd8d3e651a1a4ec3d5da9bc8eedd7 (patch) | |
tree | 29800b9a3654c094d28b76ab48c3fe336be322ce /libgfortran | |
parent | 7ded3472ae5e5eec41909fcefc911e1092479f9b (diff) | |
download | gcc-7f72e40263afd8d3e651a1a4ec3d5da9bc8eedd7.zip gcc-7f72e40263afd8d3e651a1a4ec3d5da9bc8eedd7.tar.gz gcc-7f72e40263afd8d3e651a1a4ec3d5da9bc8eedd7.tar.bz2 |
re PR fortran/80741 ([Regression 7/8] DTIO wrong code causes incorrect behaviour of namelist READ)
2017-05-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/80741
* transfer.c (finalize_transfer): Reset last_char to 'empty'.
* file_pos.c (formatted_backspace): Likewise.
(st_endfile): Likewise.
(st_rewind): Likewise.
(st_flush): Likewise.
PR fortran/80741
* trans-io.c (transfer_namelist_element): Change check from
NULL_TREE to null_pointer_node.
From-SVN: r248170
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 9 | ||||
-rw-r--r-- | libgfortran/io/file_pos.c | 6 | ||||
-rw-r--r-- | libgfortran/io/transfer.c | 2 |
3 files changed, 15 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index b604147..7fe527d 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,12 @@ +2017-05-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/80741 + * transfer.c (finalize_transfer): Reset last_char to 'empty'. + * file_pos.c (formatted_backspace): Likewise. + (st_endfile): Likewise. + (st_rewind): Likewise. + (st_flush): Likewise. + 2017-05-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/80727 diff --git a/libgfortran/io/file_pos.c b/libgfortran/io/file_pos.c index 5af9619..771d548 100644 --- a/libgfortran/io/file_pos.c +++ b/libgfortran/io/file_pos.c @@ -82,7 +82,7 @@ formatted_backspace (st_parameter_filepos *fpp, gfc_unit *u) goto io_error; u->last_record--; u->endfile = NO_ENDFILE; - + u->last_char = EOF - 1; return; io_error: @@ -322,6 +322,7 @@ st_endfile (st_parameter_filepos *fpp) unit_truncate (u, stell (u->s), &fpp->common); u->endfile = AFTER_ENDFILE; + u->last_char = EOF - 1; if (0 == stell (u->s)) u->flags.position = POSITION_REWIND; } @@ -371,6 +372,7 @@ st_endfile (st_parameter_filepos *fpp) if (u == NULL) return; u->endfile = AFTER_ENDFILE; + u->last_char = EOF - 1; } } @@ -430,6 +432,7 @@ st_rewind (st_parameter_filepos *fpp) u->current_record = 0; u->strm_pos = 1; u->read_bad = 0; + u->last_char = EOF - 1; } /* Update position for INQUIRE. */ u->flags.position = POSITION_REWIND; @@ -458,6 +461,7 @@ st_flush (st_parameter_filepos *fpp) fbuf_flush (u, u->mode); sflush (u->s); + u->last_char = EOF - 1; unlock_unit (u); } else diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 928a448..298b29e 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -3977,7 +3977,7 @@ finalize_transfer (st_parameter_dt *dtp) fbuf_seek (dtp->u.p.current_unit, 0, SEEK_END); dtp->u.p.current_unit->saved_pos = 0; - + dtp->u.p.current_unit->last_char = EOF - 1; next_record (dtp, 1); done: |