summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-04 06:50:11 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-04 06:50:11 +0000
commit99de68247c49d8dcf13ea1d273c777ed919dbf64 (patch)
treeba8bc66a951f93d24d074b3562064e4e8da744bc /libgfortran
parenteeaec7291a2bb01278fd8c1df04674db98548f98 (diff)
downloadgcc-99de68247c49d8dcf13ea1d273c777ed919dbf64.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160253 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/intrinsics/date_and_time.c6
2 files changed, 11 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index e90848cf57f..84675b92ba5 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -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
diff --git a/libgfortran/intrinsics/date_and_time.c b/libgfortran/intrinsics/date_and_time.c
index 647dd9ad7a3..21e4320e134 100644
--- a/libgfortran/intrinsics/date_and_time.c
+++ b/libgfortran/intrinsics/date_and_time.c
@@ -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)
{