mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add a few deserialization recovery paths.
This avoids cross-reference modularization error crashes in lldb/lldb-dap on Windows, seen with our internal app, reported at https://github.com/apple/swift/issues/69374.
This commit is contained in:
@@ -440,7 +440,14 @@ TypeDecl *ModuleFile::lookupNestedType(Identifier name,
|
||||
Decl *decl = declOrOffset;
|
||||
if (decl != parent)
|
||||
continue;
|
||||
return cast<TypeDecl>(getDecl(entry.second));
|
||||
Expected<Decl *> typeOrErr = getDeclChecked(entry.second);
|
||||
if (!typeOrErr) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(typeOrErr.takeError());
|
||||
diagnoseAndConsumeError(typeOrErr.takeError());
|
||||
continue;
|
||||
}
|
||||
return cast<TypeDecl>(typeOrErr.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user