public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "quic_jiafan at quicinc dot com" <sourceware-bugzilla@sourceware.org>
To: libabigail@sourceware.org
Subject: [Bug default/31513] abidiff wrongly considers data members moved to base class as harmful
Date: Tue, 02 Apr 2024 13:16:32 +0000	[thread overview]
Message-ID: <bug-31513-9487-5B0IJY7CpX@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31513-9487@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=31513

Jianfeng Fan <quic_jiafan at quicinc dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |quic_jiafan at quicinc dot com

--- Comment #14 from Jianfeng Fan <quic_jiafan at quicinc dot com> ---
Hi,
There may be an issue in the commit
https://sourceware.org/git/?p=libabigail.git;a=commit;h=338394f5454990c715b52bb4bc2ed47b39d6528b

in abg-comp-filter.cc
https://sourceware.org/git/?p=libabigail.git;a=blobdiff;f=src/abg-comp-filter.cc;h=caea9d0c5308264b40f9b07f5d1bdfebef5caae4;hp=63716775ee8ebe482a7b2f0c504e42372979d77e;hb=338394f5454990c715b52bb4bc2ed47b39d6528b;hpb=a917072c12449cfea03e79a6e82e286e0f54f57b

Added inline comments
static bool
has_subtype_changes(const string_decl_base_sptr_map& f_data_members,
                    const string_decl_base_sptr_map& s_data_members,
                    diff_context_sptr ctxt)
{
  // Now compare the offsets of the data members collected.
  var_decl_sptr s_member;
  for (auto entry : f_data_members)
    {
      var_decl_sptr f_member = is_var_decl(entry.second);
      ABG_ASSERT(f_member);

      auto i = s_data_members.find(entry.first);
      if (i == s_data_members.end())
        {
          unsigned offset = get_data_member_offset(f_member);
          s_member = find_data_member_at_offset(s_data_members, offset);
          if (!s_member)
            // A data member was suppressed; that's bad; let's consider
            // that as a sub-type change.
            return true;
        }

      if (!s_member) <<<<<<<<< we never reset s_member, so it will only be
assigned once, each f_member compare to the first s_member.
        s_member = is_var_decl(i->second);
      ABG_ASSERT(s_member);
      diff_sptr d =compute_diff(f_member->get_type(), s_member->get_type(),
ctxt);
      <<<<<<<<< we can add s_member.reset(); here, s_member can be updated next
time.
      if (d->has_changes())
        return true;
    }
  return false;
}

With this change, the result for test case report1.txt can be changed to
Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added
function
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2024-04-02 13:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20  5:57 [Bug default/31513] New: abidiff differences due to change in compiler version quic_ashudas at quicinc dot com
2024-03-20 10:22 ` [Bug default/31513] " dodji at redhat dot com
2024-03-20 10:53 ` quic_ashudas at quicinc dot com
2024-03-20 10:54 ` quic_ashudas at quicinc dot com
2024-03-20 10:54 ` quic_ashudas at quicinc dot com
2024-03-21 10:19   ` Dodji Seketeli
2024-03-20 19:14 ` woodard at redhat dot com
2024-03-21  6:51 ` quic_ashudas at quicinc dot com
2024-03-21 10:19 ` dodji at seketeli dot org
2024-03-22  6:36 ` quic_ashudas at quicinc dot com
2024-03-22  6:36 ` quic_ashudas at quicinc dot com
2024-03-22  9:20 ` dodji at redhat dot com
2024-03-22  9:20 ` dodji at redhat dot com
2024-03-28 16:41 ` [Bug default/31513] abidiff wrongly considers data members moved to base class as harmful dodji at seketeli dot org
2024-03-29 17:40 ` dodji at seketeli dot org
2024-04-01 14:28 ` quic_ashudas at quicinc dot com
2024-04-02  9:54 ` dodji at seketeli dot org
2024-04-02 13:16 ` quic_jiafan at quicinc dot com [this message]
2024-04-03  9:58   ` Dodji Seketeli
2024-04-03  9:58 ` dodji at seketeli dot org
2024-04-03 10:22 ` quic_jiafan at quicinc dot com
2024-04-03 16:26 ` dodji at seketeli dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-31513-9487-5B0IJY7CpX@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).