|
23 | 23 | #include "Scope.h" |
24 | 24 | #include "swift/AST/ASTMangler.h" |
25 | 25 | #include "swift/AST/GenericEnvironment.h" |
26 | | -#include "swift/AST/ProtocolConformance.h" |
27 | 26 | #include "swift/AST/PrettyStackTrace.h" |
28 | 27 | #include "swift/AST/PropertyWrappers.h" |
| 28 | +#include "swift/AST/ProtocolConformance.h" |
29 | 29 | #include "swift/AST/SourceFile.h" |
30 | 30 | #include "swift/AST/SubstitutionMap.h" |
31 | 31 | #include "swift/AST/TypeMemberVisitor.h" |
@@ -529,6 +529,11 @@ class SILGenConformance : public SILGenWitnessTable<SILGenConformance> { |
529 | 529 | PrettyStackTraceConformance trace("generating SIL witness table", |
530 | 530 | Conformance); |
531 | 531 |
|
| 532 | + // Check whether the conformance is valid first. |
| 533 | + Conformance->resolveValueWitnesses(); |
| 534 | + if (Conformance->isInvalid()) |
| 535 | + return nullptr; |
| 536 | + |
532 | 537 | auto *proto = Conformance->getProtocol(); |
533 | 538 | visitProtocolDecl(proto); |
534 | 539 |
|
@@ -1150,7 +1155,7 @@ class SILGenType : public TypeMemberVisitor<SILGenType> { |
1150 | 1155 | for (auto *conformance : theType->getLocalConformances( |
1151 | 1156 | ConformanceLookupKind::NonInherited)) { |
1152 | 1157 | if (auto *normal = dyn_cast<NormalProtocolConformance>(conformance)) |
1153 | | - SGM.getWitnessTable(normal); |
| 1158 | + (void)SGM.getWitnessTable(normal); |
1154 | 1159 | } |
1155 | 1160 | } |
1156 | 1161 |
|
@@ -1309,7 +1314,7 @@ class SILGenExtension : public TypeMemberVisitor<SILGenExtension> { |
1309 | 1314 | for (auto *conformance : e->getLocalConformances( |
1310 | 1315 | ConformanceLookupKind::All)) { |
1311 | 1316 | if (auto *normal =dyn_cast<NormalProtocolConformance>(conformance)) |
1312 | | - SGM.getWitnessTable(normal); |
| 1317 | + (void)SGM.getWitnessTable(normal); |
1313 | 1318 | } |
1314 | 1319 | } |
1315 | 1320 | } |
|
0 commit comments