aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuliano Procida <gprocida@google.com>2023-09-19 14:56:55 +0100
committerGiuliano Procida <gprocida@google.com>2023-10-31 17:03:46 +0000
commit346f318025c50783eed82b1b3fd92a4181d26fc3 (patch)
tree0f0ed74964b70e1e33d23829ca41cbf3628d355f
parente802ac247e740e954ecd925d1072de38be8d6e44 (diff)
downloadstg-346f318025c50783eed82b1b3fd92a4181d26fc3.tar.gz
Abigail reader: simplify check for duplicate symbol-type link
The code no longer allows duplicate links even if the relevant types have the same IDs. Better deduplication logic has been added to the Abigail reader making this no longer necessary (to the extent that it was useful at all). ABI XML models ELF symbol / DWARF declaration links as a `symbol-type-id` attribute on a `var-decl` or `function-decl` element. In older versions of `abidw` duplicate declarations (typically of member variables and functions as part of a duplicate type declaration) were often seen. The code attempted to deal with such duplicates by recording which type node ID was associated with each ELF symbol and only failing if two distinct node IDs were recorded. However, this never worked for the synthetic types generated for functions and also relied on node identity which is not meaningful in general. PiperOrigin-RevId: 566619013 Change-Id: I79a684272a3104667c93c2bd1814b6dc7f2a01e3
-rw-r--r--abigail_reader.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/abigail_reader.cc b/abigail_reader.cc
index 752af0e..2682c49 100644
--- a/abigail_reader.cc
+++ b/abigail_reader.cc
@@ -996,8 +996,8 @@ Id Abigail::ProcessDecl(bool is_variable, xmlNodePtr decl) {
// There's a link to an ELF symbol.
const auto [it, inserted] = symbol_id_and_full_name_.emplace(
*symbol_id, std::make_pair(type, name));
- if (!inserted && it->second.first != type) {
- Die() << "conflicting types for '" << *symbol_id << "'";
+ if (!inserted) {
+ Die() << "duplicate type for '" << *symbol_id << "'";
}
}
return type;