Skip to content

Commit 165930b

Browse files
committed
[Serialization] Accept DeclDeserializationUnsafe where we accepted XRef failures
1 parent 32abd32 commit 165930b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7088,7 +7088,8 @@ static llvm::Error consumeErrorIfXRefNonLoadedModule(llvm::Error &&error) {
70887088
// Missing module errors are most likely caused by an
70897089
// implementation-only import hiding types and decls.
70907090
// rdar://problem/60291019
7091-
if (error.isA<XRefNonLoadedModuleError>()) {
7091+
if (error.isA<XRefNonLoadedModuleError>() ||
7092+
error.isA<UnsafeDeserializationError>()) {
70927093
consumeError(std::move(error));
70937094
return llvm::Error::success();
70947095
}
@@ -7100,7 +7101,8 @@ static llvm::Error consumeErrorIfXRefNonLoadedModule(llvm::Error &&error) {
71007101
auto errorInfo = takeErrorInfo(std::move(error));
71017102
auto *TE = static_cast<TypeError*>(errorInfo.get());
71027103

7103-
if (TE->underlyingReasonIsA<XRefNonLoadedModuleError>()) {
7104+
if (TE->underlyingReasonIsA<XRefNonLoadedModuleError>() ||
7105+
TE->underlyingReasonIsA<UnsafeDeserializationError>()) {
71047106
consumeError(std::move(errorInfo));
71057107
return llvm::Error::success();
71067108
}
@@ -7436,6 +7438,7 @@ void ModuleFile::finishNormalConformance(NormalProtocolConformance *conformance,
74367438
// errors - we're just doing a best effort to create the
74377439
// module in that case.
74387440
if (witnessSubstitutions.errorIsA<XRefNonLoadedModuleError>() ||
7441+
witnessSubstitutions.errorIsA<UnsafeDeserializationError>() ||
74397442
allowCompilerErrors()) {
74407443
consumeError(witnessSubstitutions.takeError());
74417444
isOpaque = true;

0 commit comments

Comments
 (0)