strip_typedef() canonicalizes the stripped typed, even if the input
type was not canonicalized. This can lead to early canonicalization
that is not warranted. For instance, is_compatible_with_class_type()
calls strip_typedef() and can be called during DWARF reading on types
that haven't been canonicalized yet; this was triggering a
canonicalization what was happening too early.
With this patch, strip_typedef() does not canonicalize a stripped type
if the input type wasn't itself canonicalized.
* src/abg-ir.cc (strip_typedef): Do not canonicalize the stripped
type if the input one is not canonicalized.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
if (!t->get_environment())
set_environment_for_artifact(t, env);
- if (!canonicalize(t))
+ if (!(type->get_canonical_type() && canonicalize(t)))
keep_type_alive(t);
return t->get_canonical_type() ? t->get_canonical_type() : t;