]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/27304 (gfortran: Warn/abort when format in write does not fit passed...
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 28 Apr 2006 23:55:30 +0000 (23:55 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 28 Apr 2006 23:55:30 +0000 (23:55 +0000)
2006-04-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/27304
* io/transfer.c (formatted_transfer_scalar):  Generate error if data
descriptors are exhausted.
* io/format.c (next_format0): Fix comment.

From-SVN: r113363

libgfortran/ChangeLog
libgfortran/io/format.c
libgfortran/io/transfer.c

index 00acecfd0e360c464670011843945ae3abaa073b..c8ecbfcc07ec7a006cc1c8f6c4b5375525f9d955 100644 (file)
@@ -1,3 +1,10 @@
+2006-04-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/27304
+       * io/transfer.c (formatted_transfer_scalar):  Generate error if data
+       descriptors are exhausted.
+       * io/format.c (next_format0): Fix comment.
+
 2006-04-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libgfortran/20257
index 9528dbad277e4311c3e0d0d611369b6457ba7da2..96d7019eedcdf59e136892bd9e415ea4ed20c17e 100644 (file)
@@ -1059,7 +1059,7 @@ next_format0 (fnode * f)
 /* next_format()-- Return the next format node.  If the format list
  * ends up being exhausted, we do reversion.  Reversion is only
  * allowed if the we've seen a data descriptor since the
- * initialization or the last reversion.  We return NULL if the there
+ * initialization or the last reversion.  We return NULL if there
  * are no more data descriptors to return (which is an error
  * condition). */
 
index 743840102dbd957b947dc8b73d0727139065f9b3..43af8fbc938772bb976ac48e76e415b2b99cb750 100644 (file)
@@ -670,7 +670,13 @@ formatted_transfer_scalar (st_parameter_dt *dtp, bt type, void *p, int len,
 
       f = next_format (dtp);
       if (f == NULL)
-       return;       /* No data descriptors left (already raised).  */
+       {
+         /* No data descriptors left.  */
+         if (n > 0)
+           generate_error (&dtp->common, ERROR_FORMAT,
+               "Insufficient data descriptors in format after reversion");
+         return;
+       }
 
       /* Now discharge T, TR and X movements to the right.  This is delayed
         until a data producing format to suppress trailing spaces.  */