mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-17 07:24:34 +00:00
ir: Avoid infinite loop during type canonicalization
While looking at something else, I noticed an occurrence of infinite loop during type canonicalization, especially when cancelling canonical type propagation on some types. Fixed thus. This helps address https://bugzilla.redhat.com/show_bug.cgi?id=1951501 * src/abg-ir-priv.h (environment::priv::collect_types_that_depends_on): Don't try to collect a type that has already been collected. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
parent
4e029df894
commit
d1a8eae8ed
@ -607,6 +607,11 @@ struct environment::priv
|
||||
bool result = false;
|
||||
for (const auto i : types)
|
||||
{
|
||||
// First avoid infinite loop if we've already collected the
|
||||
// current type.
|
||||
if (collected.find(i) != collected.end())
|
||||
continue;
|
||||
|
||||
type_base *t = reinterpret_cast<type_base*>(i);
|
||||
if (t->priv_->depends_on_recursive_type(target))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user