Skip to content

Commit aaf9e67

Browse files
[Caching] Fix an assertion error when replayDiagnostic failed
Fix an assertion when replayDiagnostics failed in libSwiftScan.
1 parent 193b886 commit aaf9e67

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/libSwiftScan/SwiftCaching.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,8 +981,11 @@ static llvm::Error replayCompilation(SwiftScanReplayInstance &Instance,
981981
DH.initDiagConsumers(Invocation);
982982
DH.beginMessage(Invocation, Instance.Args);
983983

984-
if (auto E = CDP->replayCachedDiagnostics(DiagnosticsOutput->getData()))
984+
if (auto E = CDP->replayCachedDiagnostics(DiagnosticsOutput->getData())) {
985+
DH.endMessage(/*ReturnCode=*/1);
986+
Inst.getDiags().finishProcessing();
985987
return E;
988+
}
986989

987990
if (Remarks)
988991
Inst.getDiags().diagnose(SourceLoc(), diag::replay_output,

0 commit comments

Comments
 (0)