[Serialization] Handle llvm::Error in member deserialization recovery (#16957)

llvm::Expected/llvm::Error require that the error is not just checked
but explicitly handled. Since we're currently recovering as if nothing
happened, we need to use llvm::consumeError to throw the error info
away.

rdar://problem/40738521
This commit is contained in:
Jordan Rose
2018-06-19 10:14:36 -07:00
committed by GitHub
parent 9f30ed6952
commit e840330648
3 changed files with 15 additions and 0 deletions

View File

@@ -1860,6 +1860,8 @@ ModuleFile::loadNamedMembers(const IterableDeclContext *IDC, DeclBaseName N,
} else {
if (!getContext().LangOpts.EnableDeserializationRecovery)
fatal(mem.takeError());
llvm::consumeError(mem.takeError());
// Treat this as a cache-miss to the caller and let them attempt
// to refill through the normal loadAllMembers() path.
return None;