This is a follow-up of the patch below:
commit b00ba10e1d
Author: Dodji Seketeli <dodji@redhat.com>
Date: Sat May 22 01:07:26 2021 +0200
xml reader: Fix recursive qualified & reference type definition
This is a followup patch for the fix for
https://bugzilla.redhat.com/show_bug.cgi?id=1944088, which was in the
patch:
commit 51ae965305
Author: Dodji Seketeli <dodji@redhat.com>
Date: Fri May 21 23:55:44 2021 +0200
abixml reader: Fix recursive type definition handling
This patch basically adjusts build_array_type_def to build the array
type early without trying to create the array element type first. The
array type is then registered, and then the array element type is
created. That way, if the element type indirectly needs the array
type being created, then it's going to be used. Then the element type
is set to the array once it's created.
The patch adjusts the code of the array type to allow creating the
array without element types and then setting the element type later.
* include/abg-ir.h (array_type_def::update_size): Declare new
private member function.
(array_type_def::array_type_def): Declare ...
* src/abg-ir.cc (array_type_def::array_type_def): ... a new
constructor that takes no element type.
(array_type_def::update_size): Define this helper private member
function.
(array_type_def::get_subrange_representation): Adjust for this to
work when there is no element type setup yet.
(array_type_def::{set_element_type, append_subranges}): Update the
size and name of the array.
* src/abg-reader.cc (build_array_type_def): Create the array type
before the element type so that the later can re-use the former.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>