Finer detection of local changes of var_decl type
authorDodji Seketeli <dodji@redhat.com>
Fri, 8 Sep 2017 08:15:37 +0000 (10:15 +0200)
committerDodji Seketeli <dodji@redhat.com>
Fri, 8 Sep 2017 08:17:48 +0000 (10:17 +0200)
When the size of a var_decl changes, we want the 'equals' function for
var_decl to report that change as being a local one, not a subtype
one.

This patch fixes that.

* src/abg-ir.cc (equals): In the var_decl overload detect size
changes of type as being a local change.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-ir.cc

index 1276351007db22b1679c6f98f839ac6a45f2b8f7..b06bf878d0a4f2147e9565615aacc9fa9b45813e 100644 (file)
@@ -13211,7 +13211,12 @@ equals(const var_decl& l, const var_decl& r, change_kind* k)
     {
       result = false;
       if (k)
-       *k |= SUBTYPE_CHANGE_KIND;
+       {
+         if (!equals(*l.get_naked_type(), *r.get_naked_type(), 0))
+           *k |= LOCAL_CHANGE_KIND;
+         else
+           *k |= SUBTYPE_CHANGE_KIND;
+       }
       else
        return false;
     }