Commit 07fc109c by Thomas Koenig

re PR libfortran/34670 (bounds checking for array intrinsics)

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.

From-SVN: r160253
parent 308e51aa
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
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment