mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Recover from deserialization failures in ModuleFile::lookupObjCMethods
This was reported by deserialization safety in: Interpreter/SDK/Foundation_NSString.swift
This commit is contained in:
@@ -885,8 +885,13 @@ void ModuleFile::lookupObjCMethods(
|
||||
auto found = *known;
|
||||
for (const auto &result : found) {
|
||||
// Deserialize the method and add it to the list.
|
||||
if (auto func = dyn_cast_or_null<AbstractFunctionDecl>(
|
||||
getDecl(std::get<2>(result))))
|
||||
auto declOrError = getDeclChecked(std::get<2>(result));
|
||||
if (!declOrError) {
|
||||
consumeError(declOrError.takeError());
|
||||
continue;
|
||||
}
|
||||
|
||||
if (auto func = dyn_cast_or_null<AbstractFunctionDecl>(declOrError.get()))
|
||||
results.push_back(func);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user