OSDN Git Service

2010-06-04 Thomas Koenig <tkoenig@gcc.gnu.org>
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Jun 2010 06:50:11 +0000 (06:50 +0000)
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Jun 2010 06:50:11 +0000 (06:50 +0000)
PR libfortran/34670
* intrinsics/date_and_time.c:  Replace assert with runtime_error
when VALUE is too small.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160253 138bc75d-0d04-0410-961f-82ee72b054a4

libgfortran/ChangeLog
libgfortran/intrinsics/date_and_time.c

index e90848c..84675b9 100644 (file)
@@ -1,3 +1,9 @@
+2010-06-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/34670
+       * intrinsics/date_and_time.c:  Replace assert with runtime_error
+       when VALUE is too small.
+
 2010-05-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
 
        PR fortran/43851
index 647dd9a..21e4320 100644 (file)
@@ -280,8 +280,12 @@ date_and_time (char *__date, char *__time, char *__zone,
       delta = GFC_DESCRIPTOR_STRIDE(__values,0);
       if (delta == 0)
        delta = 1;
+      
+      if (unlikely (len < VALUES_SIZE))
+         runtime_error ("Incorrect extent in VALUE argument to"
+                        " DATE_AND_TIME intrinsic: is %ld, should"
+                        " be >=%ld", (long int) len, (long int) VALUES_SIZE);
 
-      assert (len >= VALUES_SIZE);
       /* Cope with different type kinds.  */
       if (elt_size == 4)
         {