summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-11 13:57:28 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-11 13:57:28 +0200
commitd7d7a32d477e8bfb66863fc332129dd909b3c013 (patch)
tree66d5f330102172aa6c2fe80215e1ce2668b663b3 /Libraries
parent95df0847c5944d7cb2bc43c8144af4ec58399b4a (diff)
downloadserenity-d7d7a32d477e8bfb66863fc332129dd909b3c013.zip
LibX86: Disassemble unknown opcodes as "db %#02x"
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibX86/Instruction.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Libraries/LibX86/Instruction.cpp b/Libraries/LibX86/Instruction.cpp
index 9d7ecc92bc..e4ae2367f5 100644
--- a/Libraries/LibX86/Instruction.cpp
+++ b/Libraries/LibX86/Instruction.cpp
@@ -1286,6 +1286,9 @@ String Instruction::to_string(u32 origin, bool x32) const
String Instruction::to_string_internal(u32 origin, bool x32) const
{
+ if (!m_descriptor)
+ return String::format("db %#02x", m_op);
+
StringBuilder builder;
String mnemonic = String(m_descriptor->mnemonic).to_lowercase();