mirror of
git://sourceware.org/git/libabigail.git
synced 2025-02-05 16:22:05 +00:00
Fix detection of entities of different kinds for diff purposes
* src/abg-comparison.cc (distinct_diff::entities_are_of_distinct_kinds): Consider two NULL decls are distinct types for the purpose of diffing. This is just a shortcut to avoid creating a null_diff type for now. But then, stop considering same pointers as different. This was a bug. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
parent
5f7ce682e2
commit
0f397606a1
@ -272,7 +272,8 @@ const decl_base_sptr
|
||||
distinct_diff::second() const
|
||||
{return second_subject();}
|
||||
|
||||
/// Test if the two arguments are of different kind.
|
||||
/// Test if the two arguments are of different kind, or that are both
|
||||
/// NULL.
|
||||
///
|
||||
/// @param first the first argument to test for similarity in kind.
|
||||
///
|
||||
@ -285,8 +286,12 @@ distinct_diff::entities_are_of_distinct_kinds(decl_base_sptr first,
|
||||
{
|
||||
if (!!first != !!second)
|
||||
return true;
|
||||
if (first == second)
|
||||
if (!first && !second)
|
||||
// We do consider diffs of two empty decls as a diff of distinct
|
||||
// kinds, for now.
|
||||
return true;
|
||||
if (first == second)
|
||||
return false;
|
||||
|
||||
return typeid(*first.get()) != typeid(*second.get());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user