mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Serialization] Use the correct module for the nested type fast path. (#11018)
Fix-up for 03e1e3b6e, which fixes the crash caused by the new test case.
More https://bugs.swift.org/browse/SR-5284
This commit is contained in:
@@ -1343,9 +1343,13 @@ ModuleFile::resolveCrossReference(ModuleDecl *baseModule, uint32_t pathLen) {
|
||||
nestedType = containingFile->lookupNestedType(memberName, baseType);
|
||||
}
|
||||
} else {
|
||||
// Fault in extensions, then ask every serialized AST in the module.
|
||||
// Fault in extensions, then ask every file in the module.
|
||||
ModuleDecl *extensionModule = M;
|
||||
if (!extensionModule)
|
||||
extensionModule = baseType->getModuleContext();
|
||||
|
||||
(void)baseType->getExtensions();
|
||||
for (FileUnit *file : baseType->getModuleContext()->getFiles()) {
|
||||
for (FileUnit *file : extensionModule->getFiles()) {
|
||||
if (file == getFile())
|
||||
continue;
|
||||
nestedType = file->lookupNestedType(memberName, baseType);
|
||||
|
||||
Reference in New Issue
Block a user