This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: illogical logic in gfc_copy_shape_excluding


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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]