This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: illogical logic in gfc_copy_shape_excluding
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 04 Mar 2005 12:08:54 +0100
- Subject: Re: illogical logic in gfc_copy_shape_excluding
- References: <4218D8BD.4040904@physik.uni-muenchen.de> <OFA818AAD2.FD86BB3D-ON42256FAF.0029808B-42256FAF.002A3928@il.ibm.com> <20050221180019.GA9370@troutmask.apl.washington.edu> <20050304015034.GC22706@troutmask.apl.washington.edu>
Steve Kargl wrote:
>>2005-02-21 Steven G. Kargl <kargls@comcast.net>
>>
>> * expr.c (gfc_copy_shape_excluding): Change && to ||.
>>
IMO this falls under the obviously correct rule.
- Tobi
>>Index: expr.c
>>===================================================================
>>RCS file: /cvs/gcc/gcc/gcc/fortran/expr.c,v
>>retrieving revision 1.22
>>diff -u -b -r1.22 expr.c
>>--- expr.c 20 Feb 2005 18:26:19 -0000 1.22
>>+++ expr.c 21 Feb 2005 17:53:21 -0000
>>@@ -355,7 +355,7 @@
>>
>> n = mpz_get_si (dim->value.integer);
>> n--; /* Convert to zero based index */
>>- if (n < 0 && n >= rank)
>>+ if (n < 0 || n >= rank)
>> return NULL;
>>
>> s = new_shape = gfc_get_shape (rank-1);