mirror of
git://sourceware.org/git/libabigail.git
synced 2025-03-06 22:58:01 +00:00
Fix crash when handling templates with empty patterns
* src/abg-ir.cc (function_tdecl::traverse): Do not crash when traversing a template with empty pattern. (class_tdecl::operator==): Do not crash when comparing templates with empty patterns. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
parent
6668baaff4
commit
daf673341e
@ -13779,7 +13779,8 @@ function_tdecl::traverse(ir_node_visitor&v)
|
||||
if (!v.visit_begin(this))
|
||||
{
|
||||
visiting(true);
|
||||
get_pattern()->traverse(v);
|
||||
if (get_pattern())
|
||||
get_pattern()->traverse(v);
|
||||
visiting(false);
|
||||
}
|
||||
return v.visit_end(this);
|
||||
@ -13872,10 +13873,13 @@ class_tdecl::operator==(const decl_base& other) const
|
||||
&& !!get_pattern() == !!o.get_pattern()))
|
||||
return false;
|
||||
|
||||
if (!get_pattern() || !o.get_pattern())
|
||||
return true;
|
||||
|
||||
return get_pattern()->decl_base::operator==(*o.get_pattern());
|
||||
}
|
||||
catch(...)
|
||||
{return false;}
|
||||
catch(...) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
|
Loading…
Reference in New Issue
Block a user