[Patch, libgfortran] [4.4/4.5 Regression] Endless loop in internal write

Jerry DeLisle jvdelisle@verizon.net
Tue Jun 30 16:51:00 GMT 2009


The following simple patch fixes this regression and passes regression testing.

I plan to commit as simple and obvious to 4.5 and 4.4.  Regression tested on 
x96-64-linux-gnu.

Thanks for the report.

Regards,

Jerry

2009-06-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/40576
	* io/transfer.c (sset): Adjust exit condition for loop.


Index: io/transfer.c
===================================================================
--- io/transfer.c	(revision 149073)
+++ io/transfer.c	(working copy)
@@ -2867,7 +2867,7 @@ sset (stream * s, int c, ssize_t nbyte)
      {
        trans = (bytes_left < WRITE_CHUNK) ? bytes_left : WRITE_CHUNK;
        trans = swrite (s, p, trans);
-      if (trans < 0)
+      if (trans <= 0)
  	return trans;
        bytes_left -= trans;
      }




More information about the Fortran mailing list