public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "dodji at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: libabigail@sourceware.org
Subject: [Bug default/28073] [libabigail] Incorrect size for bitfields
Date: Mon, 06 Dec 2021 13:54:07 +0000	[thread overview]
Message-ID: <bug-28073-9487-X52t8m0DRP@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28073-9487@http.sourceware.org/bugzilla/>

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

dodji at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #1 from dodji at redhat dot com ---
I think the correct suppression specification for this should be:

1/
[suppress_type]
        name = bigstruct
        has_data_member_inserted_between = {offset_of(bitfield0),
offset_of(other)}

Why?

because offset_after(bitfield0) means the offset of the data member that comes
after bitfiled0, in the initial version of the type.  In that version, the data
member that comes after the data member "bitfield0" is the data member "other".

So, {offset_after(bitfield0), offset_of(other)} is equivalent to:
{offset_of(other), offset_of(other)}.  And that is not what we want.

The code that evaluates the suppression specification, however, has a
tangentially related flaw:  If bitfield0 is later removed, the suppression
specification 1/ should not suppress that removal change.  That flaw is now
fixed by the commit
https://sourceware.org/git/?p=libabigail.git;a=commit;h=3e0eeb9f98216ecd1c3224f687fe1e1ef72b56e4
which also updates the documentation of to clarify the use of the
has_data_member_inserted_between property.

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

      reply	other threads:[~2021-12-06 13:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-10 19:27 [Bug default/28073] New: " david.marchand at redhat dot com
2021-12-06 13:54 ` dodji at redhat dot com [this message]

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-28073-9487-X52t8m0DRP@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).