mirror of
git://sourceware.org/git/libabigail.git
synced 2025-02-24 01:46:50 +00:00
This should fix bug https://sourceware.org/bugzilla/show_bug.cgi?id=28073 There is at least a case where the evaluation of the suppression specification rule incarnated by the property has_data_member_inserted_between doesn't work. This is in the context of the following suppression specification: [suppress_type] name = struct_foo has_data_member_inserted_between = {offset_of(dm1), offset_of(dm2)} The evaluation of the rule incarnated by has_data_member_inserted_between fails in the context of a type change where the data member "dm1" is removed from the type struct_foo. In that case, the evaluation of the suppression should ALWAYS yield to the suppression specification NOT suppressing the change. But in some cases the change is suppressed nonetheless. This patch fixes that. The idea of the patch is that if the class has a removed data member or if its size shrinks then no type change on that class can be suppressed. This is because those two kinds of change are incompatible ABI (or at least API) changes. So they should be reported. The patch also fixes the evaluation of the boundaries of the insertion range expressed as an "offset_after" expression. * doc/manuals/libabigail-concepts.rst: Update the documentation to reflect that has_data_member* properties will never suppress any type change if the change carries a data member suppression or a type size reduction. * include/abg-fwd.h (get_last_data_member) (get_next_data_member_offset): Declare new functions. * include/abg-suppression.h (insertion_range::boundary_value_is_end): Declare new static member function. (type_supression::insertion_range::eval_boundary): Make this static function take an uint64_t rather than ssize_t. (type_suppression::insertion_range::integer_boundary::{integer_boundary, as_integer, operator int}): Make these member functions and operator take or return uint64_t rather than int. * src/abg-ir.cc (get_last_data_member) (get_next_data_member_offset): Define new functions. * src/abg-suppression.cc (type_suppression::suppresses_diff): Rework logic to better handle "has_data_member_inserted_*" properties in the context of class diffs. If the diff object carries data member removal or size reduction, the diff object is not suppressed by the current type suppression. Also, the property "has_data_member_inserted_at = end", is now represented by an insertion range where the beginning and the end of the range are both the max possible value of insertion range boundaries; the code is made to recognize that. (type_suppression::insertion_range::eval_boundary): Make this static function take an uint64_t rather than ssize_t. If the boundary is expressed as a "offset_after" expression, make sure the offset of the next data member is considered if it's present. (type_suppression::insertion_range::integer_boundary::{integer_boundary, as_integer, operator int}): Make these take or return uint64_t rather than int. (type_suppression::insertion_range::boundary_value_is_end): Define new member function. (type_suppression::insertion_range::integer_boundary::priv::value_): Turn the type of this into uint64_t, from int. (type_suppression::insertion_range::integer_boundary::priv::priv): The parameter of this is now uint64_t, from int. * tests/data/test-diff-suppr/PR28073/PR28073-bitfield-removed.c: New test source code. * tests/data/test-diff-suppr/PR28073/PR28073-bitfield-removed.o: New test binary. * tests/data/test-diff-suppr/PR28073/PR28073-bitfield-removed.o.abi: New test input. * tests/data/test-diff-suppr/PR28073/PR28073-output-{1,2}.txt: New test reference output. * tests/data/test-diff-suppr/PR28073/PR28073.after.o: New test binary. * tests/data/test-diff-suppr/PR28073/PR28073.after.o.abi: New test input. * tests/data/test-diff-suppr/PR28073/PR28073.before.o: New test binary. * tests/data/test-diff-suppr/PR28073/PR28073.before.o.abi: New test input. * tests/data/test-diff-suppr/PR28073/PR28073.c: New test source code. * tests/data/test-diff-suppr/PR28073/bitfield.suppr: New test input. * tests/data/Makefile.am: Add the new test material to source distribution. * tests/test-diff-suppr.cc: Add the new test input to this test harness. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.. | ||
api | ||
manuals | ||
vizualization | ||
website | ||
Makefile.am | ||
suppr-doc.txt |