public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, applied] dwarf-reader: Avoid duplicating member functions
@ 2022-11-30 16:27 Dodji Seketeli
  0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2022-11-30 16:27 UTC (permalink / raw)
  To: libabigail

[-- Attachment #1: Type: text/plain, Size: 3914 bytes --]

From 4bdaf30bbbe31994510764b48164fe2dd20ba8bb Mon Sep 17 00:00:00 2001
From: Dodji Seketeli <dodji@redhat.com>
Date: Thu, 24 Nov 2022 17:26:35 +0100
Subject: 

Depending on how the DWARF DIEs are encountered, it can happen that
the reader mistakenly adds the same member function several times.

This is because due to DIE canonicalization, when we encounter the
class DIE C' that is equivelent to a class C that we have already
encountered, C' is dropped on the floor and C is kept.  But then, the
member functions of C' should not added to C, rather, if they are
already present in C, we shouldn't add them anymore.  This is what
build_or_get_fn_decl_if_not_suppressed is supposed to do, but fails to
do in a subtle way.

This patch fixes it.

	* src/abg-dwarf-reader.cc
	(build_or_get_fn_decl_if_not_suppressed): Fix the code that is
	supposed to avoid duplicating a member function.
	* tests/data/test-annotate/test14-pr18893.so.abi: Adjust.
	* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
	* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Likewise.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-annotate/test21-pr19092.so.abi: Likewise.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise.
	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
	Likewise.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to the master branch.
---
 src/abg-dwarf-reader.cc                       |     4 +
 .../data/test-annotate/test14-pr18893.so.abi  |  7644 ++--
 .../data/test-annotate/test15-pr18892.so.abi  |  2421 +-
 .../data/test-annotate/test17-pr19027.so.abi  |   923 +-
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 12473 ++++--
 ...19-pr19023-libtcmalloc_and_profiler.so.abi | 15673 +++----
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi |  8629 ++--
 .../data/test-annotate/test21-pr19092.so.abi  |   246 +-
 .../test-read-dwarf/PR22122-libftdc.so.abi    |  1480 +-
 .../test-read-dwarf/test-libandroid.so.abi    |   472 +-
 .../test-read-dwarf/test10-pr18818-gcc.so.abi |    65 -
 .../test-read-dwarf/test12-pr18844.so.abi     |  3162 +-
 .../test-read-dwarf/test14-pr18893.so.abi     |  5889 ++-
 .../test-read-dwarf/test15-pr18892.so.abi     |  2210 +-
 .../test-read-dwarf/test16-pr18904.so.abi     |  2048 +-
 .../test-read-dwarf/test17-pr19027.so.abi     |   821 +-
 ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 10231 +++--
 ...19-pr19023-libtcmalloc_and_profiler.so.abi | 13230 +++---
 ...st20-pr19025-libvtkParallelCore-6.1.so.abi |  8157 ++--
 .../test-read-dwarf/test21-pr19092.so.abi     |   199 +-
 .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 37377 ++++++++--------
 .../test9-pr18818-clang.so.abi                |   202 +-
 22 files changed, 71442 insertions(+), 62114 deletions(-)

The patch is too big for the mailing list so I am attaching a gziped
version of it.


[-- Attachment #2: 0001-dwarf-reader-Avoid-duplicating-member-functions.patch.gz --]
[-- Type: application/gzip, Size: 1244184 bytes --]

[-- Attachment #3: Type: text/plain, Size: 13 bytes --]


-- 
		Dodji

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-30 16:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30 16:27 [PATCH, applied] dwarf-reader: Avoid duplicating member functions Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).