diff mbox

[committed] Re: Bug in DEC UNION/STRUCT patch

Message ID CAE4aFA=LnvV-OE+QhdsgUjzrOvNsfPR5Db9hfzAyMJ9hzrzcag@mail.gmail.com
State New
Headers show

Commit Message

Fritz Reese Aug. 23, 2016, 4:14 p.m. UTC
On Mon, Aug 22, 2016 at 5:22 PM, Steve Kargl
<sgk@troutmask.apl.washington.edu> wrote:
> Fritz,
>
> I was lookng at part of a previous patch that I committed for you.
> In interface.c, one now has
>
> static int
> compare_components (gfc_component *cmp1, gfc_component *cmp2,
>     gfc_symbol *derived1, gfc_symbol *derived2)
> {
>   gfc_symbol *d1, *d2;
>   bool anonymous = false;
>
>   /* Unions, maps, and anonymous structures all have names like "[xX]X$\d+"
>      which should not be compared.  */
>   d1 = cmp1->ts.u.derived;
>   d2 = cmp2->ts.u.derived;
>   if (   (d1 && (d1->attr.flavor == FL_STRUCT || d1->attr.flavor == FL_UNION)
>           && ISUPPER (cmp1->name[1]))
>       || (d2 && (d2->attr.flavor == FL_STRUCT || d2->attr.flavor == FL_UNION)
>           && ISUPPER (cmp1->name[1])))
>     anonymous = true;
>
> Is the second ISUPPER suppose to have cmp2->name[1]?
>
> --
> Steve

This above is pretty clearly a typo. The attached patch committed as
obvious r239706.

---
Fritz Reese


2016-08-23  Fritz Reese  <fritzoreese@gmail.com>

        gcc/fortran/
        * interface.c (compare_components): Fix typo in name check conditional.
diff mbox

Patch

diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 5bd1279..17500c9 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -403,7 +403,7 @@  compare_components (gfc_component *cmp1, gfc_component *cmp2,
   if (   (d1 && (d1->attr.flavor == FL_STRUCT || d1->attr.flavor == FL_UNION)
           && ISUPPER (cmp1->name[1]))
       || (d2 && (d2->attr.flavor == FL_STRUCT || d2->attr.flavor == FL_UNION)
-          && ISUPPER (cmp1->name[1])))
+          && ISUPPER (cmp2->name[1])))
     anonymous = true;
 
   if (!anonymous && strcmp (cmp1->name, cmp2->name) != 0)