From 3e4c5cafe29b46d3e510aa9e0fc8651c95ce7144 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Fri, 8 Sep 2017 10:15:37 +0200 Subject: [PATCH] Finer detection of local changes of var_decl type 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 --- src/abg-ir.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 12763510..b06bf878 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -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; } -- 2.43.5