]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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 e90848cf57fb761253b80cd0c4c983c0bded83c4..84675b92ba5fed1db5626febcfdf925e3402d353 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 647dd9ad7a36121418f52488cb8b3439e5bb0022..21e4320e134e8bff7bffcce97f14d188eb5d3e02 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)
         {