[patch, libgfortran] Bounds checking in date_and_time.c

Thomas Koenig tkoenig@netcologne.de
Thu Jun 3 21:45:00 GMT 2010


Hello world,

this rather simple patch is the last installment of PR 34670, bounds
checking for array intrinsics.  With this out of the way, we can finally
close this PR.

I didn't make the check dependent on compile_options.bounds_checking
because I didn't see an advantage in checking an additional condition.
Also, the pre-existing behavior means that we don't really break any
existing programs, we just make a cryptic error message a bit easier
to read.  Finally, I didn't add a test case, because I don't think such
a trivial thing is worth the added running time.  I am, however, willing
to be corrected on the last issue.

Regression-tested on x86_64-unknown-linux-gnu.  OK for trunk?

	Thomas

2010-06-03  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34670
	* intrinsics/date_and_time.c:  Replace assert with runtime_error
	when VALUE is too small.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: date_and_time_c.diff
Type: text/x-patch
Size: 640 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20100603/89a84b9f/attachment.bin>


More information about the Fortran mailing list