From: "quic_johmoo at quicinc dot com" <sourceware-bugzilla@sourceware.org>
To: libabigail@sourceware.org
Subject: [Bug default/31017] Flex array conversion suppression
Date: Sat, 04 Nov 2023 00:49:42 +0000 [thread overview]
Message-ID: <bug-31017-9487-A6cmJbIjm8@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31017-9487@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=31017
--- Comment #2 from John Moon <quic_johmoo at quicinc dot com> ---
Thanks for the implementation! I think this looks great. I tested it and it
seems to be working properly for our use case in the kernel!
One question about this block:
+ // Support for the
+ // "has_strict_flexible_array_data_member_conversion = true"
+ // clause.
+ if (has_strict_fam_conversion())
+ {
+ // Let's detect if the first class of the diff has a fake
+ // flexible array data member that got turned into a real
+ // flexible array data member.
+ if (!(
+ (has_fake_flexible_array_data_member(first_class)
+ && has_flexible_array_data_member(second_class))
+ // A fake flexible array member has been changed into
+ // a real flexible array ...
+ &&
+ ((first_class->get_size_in_bits()
+ == second_class->get_size_in_bits())
+ || get_has_size_change())
+ // There was no size change or the suppression has a
+ // "has_size_change = true" clause.
+ ))
+ return false;
+ }
Is it possible for a structure to meet the first condition (fake flex -> flex)
*without* a size change? I'd think not, but may be missing something.
Basically, I think you can get rid of the first_class->get_size_in_bits() ==
second_class->get_size_in_bits() check.
Also, if we know a size change is a tautology, you could move the
get_has_size_change() check to be first and save a few CPU cycles.
Other than that, LGTM!
I went ahead and made that change and added (at least a start) on the
documentation/tests. I don't have access to make a branch, so I just sent a
patch separately. We can continue discussion there as needed.
--
You are receiving this mail because:
You are on the CC list for the bug.
next prev parent reply other threads:[~2023-11-04 0:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 18:34 [Bug default/31017] New: " quic_johmoo at quicinc dot com
2023-11-03 20:58 ` [Bug default/31017] " dodji at redhat dot com
2023-11-04 0:49 ` quic_johmoo at quicinc dot com [this message]
2023-11-05 9:43 ` Dodji Seketeli
2023-11-06 17:47 ` John Moon
2023-11-13 13:28 ` Dodji Seketeli
2023-11-05 9:43 ` dodji at seketeli dot org
2023-11-06 17:48 ` quic_johmoo at quicinc dot com
2023-11-13 13:28 ` dodji at seketeli dot org
2023-11-15 4:58 ` quic_johmoo at quicinc dot com
2023-11-15 11:48 ` dodji at redhat dot com
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-31017-9487-A6cmJbIjm8@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).