The Git repository of the Libabigail Project
Go to file
Dodji Seketeli b00ba10e1d 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

After that patch, I noticed that qualified and reference types also
need to be able to handle the case where their underlying/pointed-to
type recursively refers to the type being created.  Just like typedef
and pointer types in that patch.

This patch thus adjusts build_qualified_type_decl and
build_reference_type_def to support that.  It also adjusts the
qualified_type_def and reference_type_def classes to support being
created without underlying/pointed-to type initially.

	* include/abg-ir.h (qualified_type_def::qualified_type_def):
	Declare a constructor with no underlying type.
	(reference_type_def::reference_type_def): Declare a constructor
	with no pointed-to type.
	(reference_type_def::set_pointed_to_type): Declare new method.
	* src/abg-ir.cc (qualified_type_def::priv::priv): Define a
	constructor that takes no underlying type.
	(qualified_type_def::build_name): Make this work even on
	incomplete types with no underlying type.  In that case, this
	behaves like if the underlying type is "void".
	(qualified_type_def::qualified_type_def): Define a constructor
	that takes no underlying type.
	(qualified_type_def::get_size_in_bits): Make this work on
	incomplete types with no underlying type.
	(qualified_type_def::set_underlying_type): Adjust to properly
	update this type when a new underlying type is set.  Particularly,
	its name and the lookup maps from the type scope.
	(reference_type_def::reference_type_def): Define a constructor
	that takes no pointed-to type.
	(reference_type_def::set_pointed_to_type): Define new function.
	* src/abg-reader.cc (build_qualified_type_decl): Construct the
	qualified type early before we try to construct its underlying
	type.  Associate this incomplete type with the type-id.  Then try
	to construct the underlying type.  During its construction, if
	this incomplete qualified type is needed due to recursion then it
	can be used, leading to just one qualified type being used as it
	should be.
	(build_reference_type_def): Likewise for building incomplete
	reference type first before its pointed-to type.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2021-05-25 12:48:12 +02:00
autoconf-archive Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
bash-completion Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
doc Detect failed self comparison in type canonicalization of abixml 2021-05-25 12:16:25 +02:00
include xml reader: Fix recursive qualified & reference type definition 2021-05-25 12:48:12 +02:00
m4 Delete ltsugar.m4 and pkg.m4 files from m4/ 2015-01-06 09:54:45 +01:00
relicensing-scripts Bug 27512 - Remove broken zip-archive support 2021-03-19 10:52:57 +01:00
scripts Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
src xml reader: Fix recursive qualified & reference type definition 2021-05-25 12:48:12 +02:00
tests abixml reader: Fix recursive type definition handling 2021-05-25 12:39:57 +02:00
tools Detect abixml canonical type instability during abidw --debug-abidiff 2021-05-25 12:24:26 +02:00
.clang-format clang-format: Minor correction to not break parameters on the first line 2021-04-01 09:51:20 +02:00
.gitignore .gitignore: Add libabigail-?.* *.orig files 2019-05-22 14:34:23 +02:00
abigail.m4 Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
AUTHORS Initial AUTHORS and README 2013-02-28 13:25:20 +01:00
ChangeLog Update the Changelog for 1.8 2020-12-01 15:13:57 +01:00
COMMIT-LOG-GUIDELINES Update the COMMIT-LOG-GUIDELINES file 2016-05-22 23:20:12 +02:00
COMPILING Fix typo in COMPILING. 2020-02-03 13:49:54 +01:00
configure.ac Detect failed self comparison in type canonicalization of abixml 2021-05-25 12:16:25 +02:00
CONTRIBUTING Use C++11 for the code base 2020-12-03 14:04:23 +01:00
default.abignore Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
gen-changelog.py Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
install-sh Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
libabigail.pc.in Make libxml2 a private dependency wrt pkconfig 2013-08-22 17:41:29 +02:00
license-change-2020.txt Add a license-change-2020.txt file 2020-12-02 11:50:22 +01:00
LICENSE.txt Add the LICENSE.txt file 2020-12-02 11:49:33 +01:00
ltmain.sh Replace individual license references with SPDX Identifiers 2020-12-02 11:44:13 +01:00
Makefile.am Teach Automake that COPYING* files are gone from sources 2020-12-02 17:42:47 +01:00
NEWS Update NEWS file for 1.8 2020-12-01 15:19:12 +01:00
README Fix wording in README 2015-09-05 10:30:00 +02:00
release-text-template.txt Update the release text template after 1.0 2017-11-22 15:55:43 +01:00
update-copyright.sh Re-license the project to Apache v2 With LLVM Exception 2020-12-02 11:49:13 +01:00
VISIBILITY Control symbols exported from libabigail.so 2016-07-27 12:51:02 +02:00

This is the Application Binary Interface Generic Analysis and
Instrumentation Library.

It aims at constructing, manipulating, serializing and de-serializing
ABI-relevant artifacts.

The set of artifacts that we are intersted is made of quantities like
types, variable, fonctions and declarations of a given library or
program.  For a given library or program this set of quantities is
called an ABI corpus.

This library aims at (among other things) providing a way to compare
two ABI Corpora (apparently the plural of corpus is copora, heh,
that's cool), provide detailed information about their differences,
and help build tools to infer interesting conclusions about these
differences.

You are welcome to contribute to this project after reading the files
CONTRIBUTING and COMMIT-LOG-GUIDELINES files in the source tree.

Communicating with the maintainers of this project -- including
sending patches to be include to the source code -- happens via email
at libabigail@sourceware.org.