From eac5722ec8b140b11d0f960430eb1b4b46de6260 Mon Sep 17 00:00:00 2001 From: jvdelisle Date: Sun, 18 Feb 2018 15:32:39 +0000 Subject: 2018-02-18 Jerry DeLisle PR libgfortran/84412 * io/transfer.c (finalize_transfer): After completng an internal unit I/O operation, clear internal_unit_kind. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257791 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/io/transfer.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libgfortran/io/transfer.c') diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 8bc828c0214..df33bed1561 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -3993,6 +3993,10 @@ finalize_transfer (st_parameter_dt *dtp) if (dtp->u.p.unit_is_internal) { + /* The unit structure may be reused later so clear the + internal unit kind. */ + dtp->u.p.current_unit->internal_unit_kind = 0; + fbuf_destroy (dtp->u.p.current_unit); if (dtp->u.p.current_unit && (dtp->u.p.current_unit->child_dtio == 0) -- cgit v1.2.1