This is the mail archive of the gcc-bugs@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]

[Bug fortran/39782] [4.3/4.4 Regression] IO depends on uninitialised value



------- Comment #10 from burnus at gcc dot gnu dot org  2009-05-13 13:47 -------
For 4.4 the equivalent diff should be the following (untested). I don't see ad
hoc whether the "sfree" can be removed as well or not.

Index: libgfortran/io/transfer.c
===================================================================
--- libgfortran/io/transfer.c   (revision 147470)
+++ libgfortran/io/transfer.c   (working copy)
@@ -2148,7 +2148,6 @@ data_transfer_init (st_parameter_dt *dtp
          if (dtp->pos != dtp->u.p.current_unit->strm_pos)
            {
              fbuf_flush (dtp->u.p.current_unit, 1);
-             flush (dtp->u.p.current_unit->s);
              if (sseek (dtp->u.p.current_unit->s, dtp->pos - 1) == FAILURE)
                {
                  generate_error (&dtp->common, LIBERROR_OS, NULL);
@@ -2951,10 +2950,7 @@ finalize_transfer (st_parameter_dt *dtp)

       if (dtp->u.p.current_unit->flags.form == FORM_UNFORMATTED
          && file_position (dtp->u.p.current_unit->s) >= dtp->rec)
-       {
-         flush (dtp->u.p.current_unit->s);
-         sfree (dtp->u.p.current_unit->s);
-       }
+       sfree (dtp->u.p.current_unit->s);
       return;
     }


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39782


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