[patch,libgfortran] Fix PR25835 Segfault or Bad Address error on unformatted sequential READ

Jerry DeLisle jvdelisle@verizon.net
Tue Jan 24 06:32:00 GMT 2006


The following one liner fixes all the test cases listed in the PR.  It also 
passes regression testing and NIST testing.  Thanks to Dale Ranta for hint.

I think we really ought to get this into 4.1.  I will commit to 4.2 with all the 
test cases from the PR in the next day or so.  I would like to accelerate this 
to 4.1 if someone can give an OK.  I have asked Dale to run his tests also.

I am curious though if we will get a performance hit on this.

2006-01-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/25835
	* io/transfer.c (st_read_done): Flush buffers when read is done.


Index: io/transfer.c
===================================================================
*** io/transfer.c       (revision 109870)
--- io/transfer.c       (working copy)
*************** export_proto(st_read_done);
*** 2173,2178 ****
--- 2173,2179 ----
   void
   st_read_done (st_parameter_dt *dtp)
   {
+   flush(dtp->u.p.current_unit->s);
     finalize_transfer (dtp);
     free_format_data (dtp);
     free_ionml (dtp);



More information about the Gcc-patches mailing list