From f8d640b67ee6c5ca17e5e1094a6ecef07a553974 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 22 Apr 2016 21:23:41 +0000 Subject: [PATCH] AMDGPU: Fix crash when dumping unknown opcode I'm for some reason having a problem producing a test. It should be the same as test/MC/X86/invalid_opcode.s, but llvm-mc seems to ignore random bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267225 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-objdump/llvm-objdump.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp index c99e4b0e205..2fcd59fe2b2 100644 --- a/tools/llvm-objdump/llvm-objdump.cpp +++ b/tools/llvm-objdump/llvm-objdump.cpp @@ -405,6 +405,11 @@ public: raw_ostream &OS, StringRef Annot, MCSubtargetInfo const &STI) override { + if (!MI) { + OS << " "; + return; + } + SmallString<40> InstStr; raw_svector_ostream IS(InstStr);