[gfortran] PATCH arith.c, another range checking problem

Steve Kargl sgk@troutmask.apl.washington.edu
Tue May 18 02:04:00 GMT 2004


Gang,

This range checking problem is probably a benign bug, but I
thought we should fix it away.  The fix is obvious.

2004-05-17  Steve Kargl  <kargls@comcast.net>

        * arith.c (gfc_int2complex): Incorrect range checking.

-- 
Steve
-------------- next part --------------
Index: arith.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/arith.c,v
retrieving revision 1.7
diff -u -b -r1.7 arith.c
--- arith.c	17 May 2004 23:54:09 -0000	1.7
+++ arith.c	18 May 2004 01:41:01 -0000
@@ -2595,7 +2595,7 @@
   mpf_set_z (result->value.complex.r, src->value.integer);
   mpf_set_ui (result->value.complex.i, 0);
 
-  if ((rc = gfc_check_real_range (result->value.complex.i, kind)) != ARITH_OK)
+  if ((rc = gfc_check_real_range (result->value.complex.r, kind)) != ARITH_OK)
     {
       arith_error (rc, &src->ts, &result->ts, &src->where);
       gfc_free_expr (result);


More information about the Fortran mailing list