Skip to content

Commit fcf398a

Browse files
author
David Ungar
committed
Don't crash on a bad -j input
1 parent bbe1310 commit fcf398a

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
@@ -191,6 +191,8 @@ static int run_driver(StringRef ExecName,
191191

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

0 commit comments

Comments
 (0)