Skip to content

Commit 6f9df09

Browse files
author
David Ungar
authored
Merge pull request swiftlang#33701 from davidungar/handle-bad-j
Don't crash on a bad -j input
2 parents 76d0648 + fcf398a commit 6f9df09

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

test/Driver/badJ.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// RUN: not %swiftc_driver %S/../Inputs/empty.swift -jsnort 2>&1 | %FileCheck %s
2+
// CHECK-NOT: Stack dump

tools/driver/driver.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ static int run_driver(StringRef ExecName,
192192

193193
if (C) {
194194
std::unique_ptr<sys::TaskQueue> TQ = TheDriver.buildTaskQueue(*C);
195+
if (!TQ)
196+
return 1;
195197
return C->performJobs(std::move(TQ));
196198
}
197199

0 commit comments

Comments
 (0)