Skip to content

Commit b96298a

Browse files
committed
Deserializer: flush the diag engine to see a function type mismatch error
Fixes a not-printed error message. rdar://127767886
1 parent 09b8b08 commit b96298a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/Serialization/DeserializeSIL.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,11 @@ SILFunction *SILDeserializer::getFuncForReference(StringRef name,
430430
if (auto *decl = dyn_cast_or_null<AbstractFunctionDecl>(dc->getAsDecl()))
431431
fnName = decl->getNameStr();
432432
}
433-
fn->getModule().getASTContext().Diags.diagnose(
434-
fn->getLocation().getSourceLoc(),
435-
diag::deserialize_function_type_mismatch,
436-
fnName, fnType.getASTType(), type.getASTType());
433+
auto &diags = fn->getModule().getASTContext().Diags;
434+
diags.diagnose(fn->getLocation().getSourceLoc(),
435+
diag::deserialize_function_type_mismatch,
436+
fnName, fnType.getASTType(), type.getASTType());
437+
diags.flushConsumers();
437438
exit(1);
438439
}
439440
return fn;

0 commit comments

Comments
 (0)