Skip to content

Commit 69bb2a7

Browse files
committed
SILGen: Crash better when useConformance() is handed an invalid conformance
1 parent 4a124f1 commit 69bb2a7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/SILGen/SILGenLazyConformance.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ using namespace swift;
2121
using namespace swift::Lowering;
2222

2323
void SILGenModule::useConformance(ProtocolConformanceRef conformanceRef) {
24+
// If the conformance is invalid, crash deterministically even in noassert
25+
// builds.
26+
if (conformanceRef.isInvalid()) {
27+
llvm::report_fatal_error("Invalid conformance in type-checked AST");
28+
}
29+
2430
// We don't need to emit dependent conformances.
2531
if (conformanceRef.isAbstract())
2632
return;

0 commit comments

Comments
 (0)