ir: Fix a potential crash in canonicalize_types

I noticed crashes in canonicalize_types when it deals with nullptr
types.  Fixed thus.

	* src/abg-ir-priv.h (canonicalize_types): Avoid crashing when
	de-referencing an iterator to a nullptr type.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2024-07-09 16:57:26 +02:00
parent 076985bbe9
commit 9d14151e15
1 changed files with 1 additions and 1 deletions

View File

@ -1620,7 +1620,7 @@ canonicalize_types(const input_iterator& begin,
// First, let's compute the canonical type of this type.
for (t = begin,i = 0; t != end; ++t, ++i)
{
if (deref(t)->get_environment().priv_->do_log())
if (deref(t) && deref(t)->get_environment().priv_->do_log())
std::cerr << "#" << std::dec << i << " ";
canonicalize(deref(t));