Don't early-canonicalize function types when reading abixml
authorDodji Seketeli <dodji@redhat.com>
Thu, 15 Dec 2016 13:12:57 +0000 (14:12 +0100)
committerDodji Seketeli <dodji@redhat.com>
Thu, 15 Dec 2016 15:25:41 +0000 (16:25 +0100)
When reading from an abixml file, we sometimes canonicalize function
types before the entire abixml file is read.  This can lead to, e.g, a
function type that is not yet fully built being canonicalized too
early and so its canonical type being wrong because it reflects the
state of the function type at canonicalization time -- but then that
state changed later.

This patch fixes that by forcing us to late-canonicalize function
types, just like we do for all aggregate types.

* src/abg-reader.cc (read_context::maybe_canonicalize_type):
late-canonicalize function types too.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-reader.cc

index 235c816d15f0b1b25b6306d52ec73a4229216750..1ba7379c8727dd1118bd4d6777b92498bb699d9d 100644 (file)
@@ -838,7 +838,8 @@ public:
        && !is_pointer_type(t)
        && !is_qualified_type(t)
        && !is_typedef(t)
-       && !is_enum_type(t))
+       && !is_enum_type(t)
+       && !is_function_type(t))
       canonicalize(t);
     else
       {