[PATCH] fortran/37930 -- Fix clever user trick

Steve Kargl sgk@troutmask.apl.washington.edu
Tue Oct 28 05:07:00 GMT 2008


This patch fixes the conversion of an NaN or Inf value to
an integer by disallowing such a questionable action.


2008-10-27  Steven G. Kargl  <kargls@comcast.net>

	PR fortran/37930
	* gfortran.dg/int_conv_2.f90:  New test.

2008-10-27  Steven G. Kargl  <kargls@comcast.net>

	PR fortran/37930
	* fortran/arith.c (gfc_mpfr_to_mpz):  Test for NaN and Inf values.
	(gfc_real2int): Error on conversion of NaN or Inf.
	(gfc_complex2int): Ditto.
	* fortran/arith.h: Update mpfr_to_mpz prototype.
	* fortran/simplify.c (gfc_simplify_ceiling, gfc_simplify_floor,
	gfc_simplify_ifix, gfc_simplify_idint, simplify_nint): Update function
	calls to include locus

-- 
steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr37930.diff
Type: text/x-diff
Size: 4090 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20081028/b8e3aac0/attachment.bin>


More information about the Fortran mailing list