File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -505,7 +505,9 @@ int main(int Argc, const char **Argv) {
505
505
bool IsCrash = false ;
506
506
Driver::CommandStatus CommandStatus = Driver::CommandStatus::Ok;
507
507
// Pretend the first command failed if ReproStatus is Always.
508
- const Command *FailingCommand = &*C->getJobs ().begin ();
508
+ const Command *FailingCommand = nullptr ;
509
+ if (!C->getJobs ().empty ())
510
+ FailingCommand = &*C->getJobs ().begin ();
509
511
if (C && !C->containsError ()) {
510
512
SmallVector<std::pair<int , const Command *>, 4 > FailingCommands;
511
513
Res = TheDriver.ExecuteCompilation (*C, FailingCommands);
@@ -542,8 +544,9 @@ int main(int Argc, const char **Argv) {
542
544
// crash, but only if we're crashing due to FORCE_CLANG_DIAGNOSTICS_CRASH.
543
545
if (::getenv (" FORCE_CLANG_DIAGNOSTICS_CRASH" ))
544
546
llvm::dbgs () << llvm::getBugReportMsg ();
545
- if (TheDriver.maybeGenerateCompilationDiagnostics (CommandStatus, ReproLevel,
546
- *C, *FailingCommand))
547
+ if (FailingCommand != nullptr &&
548
+ TheDriver.maybeGenerateCompilationDiagnostics (CommandStatus, ReproLevel,
549
+ *C, *FailingCommand))
547
550
Res = 1 ;
548
551
549
552
Diags.getClient ()->finish ();
You can’t perform that action at this time.
0 commit comments