Skip to content

Commit fdbeb45

Browse files
committed
SIL linker: don't try to synthesize witness tables for marker protocols.
We never have them, we never need them, and we'll crash if there were one for a conformance of a non-nominal type to such a protocol. Fixes rdar://91126885 .
1 parent 3bb3ffd commit fdbeb45

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/SIL/IR/Linker.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ void SILLinkerVisitor::visitProtocolConformance(ProtocolConformanceRef ref) {
259259
if ((!WT || WT->isDeclaration()) &&
260260
(mustDeserialize || Mode == SILModule::LinkingMode::LinkAll)) {
261261
if (!WT) {
262+
// Marker protocols should never have witness tables.
263+
if (C->getProtocol()->isMarkerProtocol())
264+
return;
265+
262266
RootProtocolConformance *rootC = C->getRootConformance();
263267
SILLinkage linkage = getLinkageForProtocolConformance(rootC, NotForDefinition);
264268
WT = SILWitnessTable::create(Mod, linkage,

0 commit comments

Comments
 (0)