libabigail/tests
Dodji Seketeli 9b4d20db90 Bug 18342 - Segmentation fault while comparing functions with variadic parameters
In the IR built from DWARF, a variadic variadic parameter has an empty
type.  Later during type comparison, comparing an empty (NULL) type
with other types proves to be troublesome.

This patch handles the issue by creating a new kind of
abigail::type_decl type specifically for variadic parameters.  This is
like what is done for void types.

After that it appears that the categorizing sub-system flags a change
of variadic type to non-variadic type as redundant if that change
appears several times on different functions.  We don't want that
because it can hide important changes we want to see.  The patch fixes
that too.

	* include/abg-fwd.h (is_array_type): New overload for a naked
	pointer.
	* include/abg-ir.h (type_decl::get_variadic_parameter_type_decl): Declare new
	static function.
	* src/abg-ir.cc (is_array_type): Define new function overload for
	naked pointers
	(type_decl::get_variadic_parameter_type_decl): Define new static
	function.
	* src/abg-dwarf-reader.cc (build_function_decl): The type of
	variadic parameter is now a special type_decl.
	* include/abg-comparison.h (is_diff_of_variadic_parameter_type)
	(is_diff_of_variadic_parameter): New function declarations.
	* src/abg-comparison.cc (is_diff_of_variadic_parameter_type)
	(is_diff_of_variadic_parameter): Define new functions.
	(compute_diff): Refuse to return a NULL
	diff for types.  Assert that the parameters are non-NULL.
	(report_size_and_alignment_changes): We are comparing arrays only
	if the two parameters are arrays.
	(fn_parm_diff::fn_parm_diff): Refuse that type diff for this diff
	node is non empty.
	(fn_parm_diff::report): Strengthen an assert.  Cleanup a comment.
	(redundancy_marking_visitor::visit_begin): Do not mark function
	type and variadic parms diff nodes as redundant for local changes.
	* tests/data/test-diff-dwarf/libtest26-added-parms-before-variadic-v{0,1}.so:
	New test input binaries.
	* tests/data/test-diff-dwarf/test26-added-parms-before-variadic-report.txt:
	New test output reference.
	* tests/data/test-diff-dwarf/test26-added-parms-before-variadic-v{0,1}.c:
	Source code of the new test input binaries above.
	* tests/data/Makefile.am: Add the new test stuff to source
	distribution.
	* tests/test-diff-dwarf.cc (in_out_specs): Add the new test inputs
	above to the set of input to run this test harness over.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-05-05 10:45:06 +02:00
..
data Bug 18342 - Segmentation fault while comparing functions with variadic parameters 2015-05-05 10:45:06 +02:00
Makefile.am Canonicalize types either early or late after TU reading 2015-02-18 21:32:37 +01:00
print-diff-tree.cc Add support for abicompat weak mode 2015-04-03 22:45:41 +02:00
runtestcanonicalizetypes.sh.in Fix the new regression test for type canonicalizing 2015-02-19 11:44:19 +01:00
test-abicompat.cc Make abidiff and abicompat return meaningful exit codes 2015-04-10 16:26:36 +02:00
test-abidiff.cc 18166 - Abidiff fails with internal on Libtirpc ABI in XML format 2015-03-30 09:50:44 +02:00
test-alt-dwarf-file.cc Expose a new libabigail::tools_utils namespace 2015-01-08 12:28:14 +01:00
test-core-diff.cc Expose a new libabigail::tools_utils namespace 2015-01-08 12:28:14 +01:00
test-diff2.cc Update copyright years 2015-01-07 17:52:10 +01:00
test-diff-dwarf.cc Bug 18342 - Segmentation fault while comparing functions with variadic parameters 2015-05-05 10:45:06 +02:00
test-diff-filter.cc Make abidiff and abicompat return meaningful exit codes 2015-04-10 16:26:36 +02:00
test-diff-suppr.cc Make abidiff and abicompat return meaningful exit codes 2015-04-10 16:26:36 +02:00
test-dot.cc
test-ir-walker.cc Canonicalize types either early or late after TU reading 2015-02-18 21:32:37 +01:00
test-lookup-syms.cc Expose a new libabigail::tools_utils namespace 2015-01-08 12:28:14 +01:00
test-read-dwarf.cc Add support for abicompat weak mode 2015-04-03 22:45:41 +02:00
test-read-write.cc Expose a new libabigail::tools_utils namespace 2015-01-08 12:28:14 +01:00
test-svg.cc
test-utils.cc Update copyright years 2015-01-07 17:52:10 +01:00
test-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
test-write-read-archive.cc Fix archive writing support 2015-04-24 19:59:19 +02:00