Fix false compatibility return status on extension.
Also, don't diff unreferenced anonymous records.
Bug: 64267858
Bug: 72697345
Test: Extend libjpeg by adding an exported function, also add an unused struct;
Without this change: build shows an 'error' message, but does not fail.
With this change in prebuilts : build shows 'error' message and
fails.
Test: tests/test.py passes.
Change-Id: Ief7ed90715a9c1a25736c10449833650c73d3db3
This commit is contained in:
@@ -105,11 +105,15 @@ HeaderAbiDiff::ExtractUserDefinedTypes(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const abi_util::TypeIR *type = *(odr_list.begin());
|
const abi_util::TypeIR *type = *(odr_list.begin());
|
||||||
|
const abi_util::RecordTypeIR *record_type = nullptr;
|
||||||
switch (type->GetKind()) {
|
switch (type->GetKind()) {
|
||||||
case abi_util::RecordTypeKind:
|
case abi_util::RecordTypeKind:
|
||||||
|
record_type = static_cast<const abi_util::RecordTypeIR *>(type);
|
||||||
|
if (record_type->IsAnonymous()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
record_types.emplace(
|
record_types.emplace(
|
||||||
static_cast<const abi_util::RecordTypeIR *>(type)->GetUniqueId(),
|
record_type->GetUniqueId(), record_type);
|
||||||
static_cast<const abi_util::RecordTypeIR *>(type));
|
|
||||||
break;
|
break;
|
||||||
case abi_util::EnumTypeKind:
|
case abi_util::EnumTypeKind:
|
||||||
enum_types.emplace(
|
enum_types.emplace(
|
||||||
|
|||||||
@@ -183,15 +183,15 @@ int main(int argc, const char **argv) {
|
|||||||
<< "******************************************************\n";
|
<< "******************************************************\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((allow_extensions &&
|
if (!advice_only && ((!allow_extensions &&
|
||||||
(status & abi_util::CompatibilityStatusIR::Extension)) ||
|
(status & abi_util::CompatibilityStatusIR::Extension)) ||
|
||||||
(allow_unreferenced_changes &&
|
(!allow_unreferenced_changes &&
|
||||||
(status & abi_util::CompatibilityStatusIR::UnreferencedChanges)) ||
|
(status & abi_util::CompatibilityStatusIR::UnreferencedChanges)) ||
|
||||||
(allow_unreferenced_elf_symbol_changes &&
|
(!allow_unreferenced_elf_symbol_changes &&
|
||||||
(status & abi_util::CompatibilityStatusIR::ElfIncompatible)) ||
|
(status & abi_util::CompatibilityStatusIR::ElfIncompatible)) ||
|
||||||
advice_only) {
|
(status & abi_util::CompatibilityStatusIR::Incompatible))) {
|
||||||
return abi_util::CompatibilityStatusIR::Compatible;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return abi_util::CompatibilityStatusIR::Compatible;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user