[PS5] Avoid a driver crash

In some cases, an error constructing a compiler or assembler job could
leave the Inputs in a state that the code for constructing the linker
job was not ready for.
This commit is contained in:
Paul Robinson 2022-04-19 15:55:01 -07:00
parent 8c64928887
commit 20c873c12f
2 changed files with 7 additions and 2 deletions

View File

@ -255,6 +255,10 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs,
continue;
}
// In some error cases, the input could be Nothing; skip those.
if (II.isNothing())
continue;
// Otherwise, this is a linker input argument.
const Arg &A = II.getInputArg();

View File

@ -13,8 +13,9 @@
// DEFAULT-NOT: -no-integrated-as
// RUN: %clang -target x86_64-sie-ps5 -### -no-integrated-as %s -c 2>&1 \
/// -c omitted on purpose, this used to crash.
// RUN: %clang -target x86_64-sie-ps5 -### -no-integrated-as %s 2>&1 \
// RUN: | FileCheck %s -check-prefix PS5
// RUN: %clang -target x86_64-sie-ps5 -### -no-integrated-as %s -c -x assembler 2>&1 \
// RUN: %clang -target x86_64-sie-ps5 -### -no-integrated-as %s -x assembler 2>&1 \
// RUN: | FileCheck %s -check-prefix PS5
// PS5: there is no external assembler that can be used on this platform