From 8c6f5533d4124e09d864ca5db2140acbd4a12777 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Sun, 7 Dec 2014 17:52:34 +0100 Subject: [PATCH] Correctly handle the case where we do not have Instruction Analysis --- src/disassembler/llvm/LLVMDisassembler.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/disassembler/llvm/LLVMDisassembler.cxx b/src/disassembler/llvm/LLVMDisassembler.cxx index c2b0527..8837239 100644 --- a/src/disassembler/llvm/LLVMDisassembler.cxx +++ b/src/disassembler/llvm/LLVMDisassembler.cxx @@ -92,8 +92,11 @@ LLVMDisassembler::LLVMDisassembler(const std::string& filename) RelInfo.release(); Symzer.release(); - MIA.reset(target->createMCInstrAnalysis(MII.get())); + if (!MIA) { + LOG4CXX_ERROR(logger, "no instruction analysis for target " << tripleName); + return; + } int AsmPrinterVariant = AsmInfo->getAssemblerDialect(); IP.reset(target->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI)); -- 2.39.5