SILLinker: make sure to de-serialize base protocol witness tables in embedded mode

Fixes unresolved symbol linker errors or compiler crashes
rdar://148538336
This commit is contained in:
Erik Eckstein
2025-04-04 10:04:06 +02:00
parent 1b2f8c3a19
commit 8978e07b4a
2 changed files with 11 additions and 2 deletions

View File

@@ -342,8 +342,10 @@ void SILLinkerVisitor::visitProtocolConformance(
// reading in most conformances until we need them for devirtualization.
// However, we *must* pull in shared clang-importer-derived conformances
// we potentially use, since we may not otherwise have a local definition.
if (mustDeserializeProtocolConformance(Mod, c))
if ((isEmbedded && referencedFromInitExistential) ||
mustDeserializeProtocolConformance(Mod, c)) {
visitProtocolConformance(c, referencedFromInitExistential);
}
};
// For each entry in the witness table...