kfdtest: Check for NULL at MCABackend creation
The function can return NULL if it fails to create the backend, so check
for NULL before using it.
Change-Id: I4d6501bffd6dd0fc0d0f2224720f7d6dca1646f3
Signed-off-by: Kent Russell <kent.russell@amd.com>
[ROCm/ROCR-Runtime commit: 545467be04]
This commit is contained in:
@@ -350,6 +350,11 @@ int Assembler::RunAssemble(const char* const AssemblySource) {
|
||||
#endif
|
||||
MCAsmBackend* MAB = TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions);
|
||||
|
||||
if (!MAB) {
|
||||
outs() << "ASM Error: Unable to create MCA Backend\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::unique_ptr<MCStreamer> Streamer(TheTarget->createMCObjectStreamer(
|
||||
TheTriple, Ctx,
|
||||
std::unique_ptr<MCAsmBackend>(MAB), MAB->createObjectWriter(*OS),
|
||||
|
||||
Reference in New Issue
Block a user