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]

[patch, libfortran][4.4.1 Regression] PR40714 Incorrect I/O behavior


The following patch has been committed to trunk.

I would like permission to commit t0 4.4.1 before release.

This fixes a problem handling certain error conditions. We can show that the bug can produce very large files with an empty write statement. The patch itself is simple and un-intrusive.

OK to commit to 4.4.1 Jakub?

Regards,

Jerry

Index: io/transfer.c
===================================================================
--- io/transfer.c       (revision 149756)
+++ io/transfer.c       (working copy)
@@ -3103,7 +3103,11 @@ finalize_transfer (st_parameter_dt *dtp)
     }

   if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
-    return;
+    {
+      if (dtp->u.p.current_unit && current_mode (dtp) ==
UNFORMATTED_SEQUENTIAL)
+       dtp->u.p.current_unit->current_record = 0;
+      return;
+    }

   if ((dtp->u.p.ionml != NULL)
       && (cf & IOPARM_DT_HAS_NAMELIST_NAME) != 0)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]