mirror of
git://sourceware.org/git/libabigail.git
synced 2025-02-01 06:11:37 +00:00
Better detection of void* to something* change
Whenever a void* pointer changes to a T* pointer, we already consider that change to be ABI-compatible. The issue though is that we don't detect the case of foo* changing into T* where foo is typedef void foo. This patch fixes that. * include/abg-ir.h (is_void_type): Add a new overload that takes type_base*. * src/abg-ir.cc (is_void_type): Define the new overload that takes type_base*. (is_void_pointer_type): Look through typedefs in the pointed-to type. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
parent
fc02416b28
commit
0036d0448e
@ -175,6 +175,9 @@ public:
|
||||
bool
|
||||
is_void_type(const type_base_sptr&) const;
|
||||
|
||||
bool
|
||||
is_void_type(const type_base*) const;
|
||||
|
||||
bool
|
||||
is_variadic_parameter_type(const type_base*) const;
|
||||
|
||||
|
@ -2590,6 +2590,21 @@ environment::is_void_type(const type_base_sptr& t) const
|
||||
return t.get() == get_void_type().get();
|
||||
}
|
||||
|
||||
/// Test if a given type is a void type as defined in the current
|
||||
/// environment.
|
||||
///
|
||||
/// @param t the type to consider.
|
||||
///
|
||||
/// @return true iff @p t is a void type as defined in the current
|
||||
/// environment.
|
||||
bool
|
||||
environment::is_void_type(const type_base* t) const
|
||||
{
|
||||
if (!t)
|
||||
return false;
|
||||
return t == get_void_type().get();
|
||||
}
|
||||
|
||||
/// Test if a type is a variadic parameter type as defined in the
|
||||
/// current environment.
|
||||
///
|
||||
@ -7080,8 +7095,11 @@ is_void_pointer_type(const type_base* type)
|
||||
if (!t)
|
||||
return 0;
|
||||
|
||||
if (t->get_environment()->is_void_type(t->get_pointed_to_type()))
|
||||
return t;
|
||||
// Look through typedefs in the pointed-to type as well.
|
||||
type_base * ty = t->get_pointed_to_type().get();
|
||||
ty = peel_qualified_or_typedef_type(ty);
|
||||
if (ty->get_environment()->is_void_type(ty))
|
||||
return ty;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user