[dwarf-reader] Don't early canonicalize function types
authorDodji Seketeli <dodji@redhat.com>
Thu, 5 Jan 2017 00:05:04 +0000 (01:05 +0100)
committerDodji Seketeli <dodji@redhat.com>
Thu, 5 Jan 2017 11:26:20 +0000 (12:26 +0100)
Make sure we don't early-canonicalize function types.  We need to wait
after the end of building the ABI corpus before canonicalizing these.

Normally this should be taken care of by using
type_has_non_canonicalized_subtype but there are cases where that
function does not detect that a type has sub-types that are not
canonicalized.

Fixed thus.

* src/abg-dwarf-reader.cc (maybe_canonicalize_type):
Late-canonicalize function types.

signed-off-by: Dodji Seketeli <dodji@redhat.com>

src/abg-dwarf-reader.cc

index 9d353457c2dd200c9fcf2f40550d41e5fcdf3897..048dec4ef5c256a0f3ebe79a90fc58158ad18735 100644 (file)
@@ -11973,7 +11973,9 @@ maybe_canonicalize_type(Dwarf_Die *die, read_context&   ctxt)
   assert(t);
 
   type_base_sptr peeled_type = peel_typedef_pointer_or_reference_type(t);
-  if (is_class_type(peeled_type) || is_union_type(peeled_type))
+  if (is_class_type(peeled_type)
+      || is_union_type(peeled_type)
+      || is_function_type(peeled_type))
     // We delay canonicalization of classes/unions or typedef,
     // pointers, references and array to classes/unions.  This is
     // because the (underlying) class might not be finished yet and we