Merge pull request #77285 from xymus/recover-under-loadObjCMethods

Serialization: Recover from errors under `loadObjCMethods`
This commit is contained in:
Alexis Laferrière
2024-11-07 13:51:34 -08:00
committed by GitHub
2 changed files with 46 additions and 1 deletions

View File

@@ -713,8 +713,15 @@ void ModuleFile::loadObjCMethods(
continue;
// Deserialize the method and add it to the list.
// Drop methods with errors.
auto funcOrError = getDeclChecked(std::get<2>(result));
if (!funcOrError) {
diagnoseAndConsumeError(funcOrError.takeError());
continue;
}
if (auto func = dyn_cast_or_null<AbstractFunctionDecl>(
getDecl(std::get<2>(result)))) {
funcOrError.get())) {
methods.push_back(func);
}
}