mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SIL: Skip visiting bad extensions in SILSymbolVisitor.
When lazy typechecking is enabled, extensions that do not typecheck can make it to TBDGen, which would crash during its AST walk because `SILSymbolVisitor` tried to dereference the null nominal type for the extension. Resolves rdar://139320515.
This commit is contained in:
@@ -735,6 +735,9 @@ public:
|
||||
|
||||
void visitExtensionDecl(ExtensionDecl *ED) {
|
||||
auto nominal = ED->getExtendedNominal();
|
||||
if (!nominal)
|
||||
return;
|
||||
|
||||
if (canSkipNominal(nominal))
|
||||
return;
|
||||
|
||||
|
||||
@@ -8,3 +8,7 @@ public protocol P {
|
||||
// expected-error@+1 {{type 'S' does not conform to protocol 'P'}}
|
||||
public struct S: P {
|
||||
}
|
||||
|
||||
extension DoesNotExist {
|
||||
public func method() {}
|
||||
}
|
||||
Reference in New Issue
Block a user