Correctly handle the case where we do not have Instruction Analysis
authorChristoph Egger <christoph@anonymous.siccegge.de>
Sun, 7 Dec 2014 16:52:34 +0000 (17:52 +0100)
committerChristoph Egger <christoph@anonymous.siccegge.de>
Sun, 7 Dec 2014 16:52:34 +0000 (17:52 +0100)
src/disassembler/llvm/LLVMDisassembler.cxx

index c2b0527f1f33b2a158c8505776d034e6cbad4e20..8837239ca74d6b671613cfa1240a94c7f0fd71f2 100644 (file)
@@ -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));