Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit f8d640b

Browse files
committed
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
1 parent 74eabdd commit f8d640b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/llvm-objdump/llvm-objdump.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,11 @@ class AMDGCNPrettyPrinter : public PrettyPrinter {
405405
raw_ostream &OS,
406406
StringRef Annot,
407407
MCSubtargetInfo const &STI) override {
408+
if (!MI) {
409+
OS << " <unknown>";
410+
return;
411+
}
412+
408413
SmallString<40> InstStr;
409414
raw_svector_ostream IS(InstStr);
410415

0 commit comments

Comments
 (0)