Skip to content

Commit f24fd24

Browse files
committed
SIL: Don't attempt to deserialize witness tables on lookup in lowered SIL.
1 parent 8cf2d90 commit f24fd24

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/SIL/SILModule.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,18 @@ SILModule::lookUpWitnessTable(const ProtocolConformance *C,
186186
if (wtable->isDefinition())
187187
return wtable;
188188

189+
// If the module is at or past the Lowered stage, then we can't do any
190+
// further deserialization, since pre-IRGen SIL lowering changes the types
191+
// of definitions to make them incompatible with canonical serialized SIL.
192+
switch (getStage()) {
193+
case SILStage::Canonical:
194+
case SILStage::Raw:
195+
break;
196+
197+
case SILStage::Lowered:
198+
return wtable;
199+
}
200+
189201
// Otherwise try to deserialize it. If we succeed return the deserialized
190202
// function.
191203
//

0 commit comments

Comments
 (0)