This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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, libgfortran] Fix PR27304 Data descriptors exhausted


:ADDPATCH fortran:

The attached patch adds a run time error when there are no data descriptors available in a format string for the data.

This gives a runtime error for the test case in the pr. Regression tested, NIST tested.

I have attached a test case so you can see the behavior. I have not got the dg-do magic right yet, but you can get the idea. (Don't no why I have brain block on that testsuite magic)

OK for trunk and 4.1? testcase to follow when I fix it.

Regards,

Jerry

2006-04-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>

	PR libgfortran/27304
	* io/transfer.c (formatted_transfer_scaler):  Generate error if data
	descriptors are exhausted.
Index: io/transfer.c
===================================================================
*** io/transfer.c	(revision 113213)
--- io/transfer.c	(working copy)
*************** formatted_transfer_scalar (st_parameter_
*** 670,676 ****
  
        f = next_format (dtp);
        if (f == NULL)
! 	return;	      /* No data descriptors left (already raised).  */
  
        /* Now discharge T, TR and X movements to the right.  This is delayed
  	 until a data producing format to suppress trailing spaces.  */
--- 670,682 ----
  
        f = next_format (dtp);
        if (f == NULL)
! 	{
! 	  /* No data descriptors left.  */
! 	  if (n > 0)
! 	    generate_error (&dtp->common, NULL,
! 				"Data descriptors exhausted in format");
! 	  return;
! 	}
  
        /* Now discharge T, TR and X movements to the right.  This is delayed
  	 until a data producing format to suppress trailing spaces.  */

Attachment: fmt_exhaust.f90
Description: application/extension-f90


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