[11/16] ir: Fix forgetting canonicalizing some function types
Commit Message
Hello,
It appears some function types are not canonicalized. Fixed thus.
* src/abg-ir.cc (maybe_adjust_canonical_type): Once a missing
member function has been copied from it's destination to the
freshly canonicalized type, make sure the type of the member
function is canonicalized as well.
(copy_member_function): Bind the lifetime of the new function type
to the lifetime of the current translation unit.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
src/abg-ir.cc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
@@ -15006,7 +15006,11 @@ maybe_adjust_canonical_type(const type_base_sptr& canonical,
// class doesn't have that member function. Let's
// copy that member function to the canonical class
// then.
- copy_member_function (canonical_class, *i);
+ {
+ method_decl_sptr method =
+ copy_member_function (canonical_class, *i);
+ canonicalize(method->get_type());
+ }
}
}
}
@@ -22873,7 +22877,7 @@ copy_member_function(const class_or_union_sptr& t, const method_decl* method)
old_type->get_is_const(),
old_type->get_size_in_bits(),
old_type->get_alignment_in_bits()));
- keep_type_alive(new_type);
+ t->get_translation_unit()->bind_function_type_life_time(new_type);
method_decl_sptr
new_method(new method_decl(method->get_name(),