llvm_disassemble: Allow disassembly of invalid AArch64 instructions

This commit is contained in:
MerryMage 2018-06-27 15:06:04 +01:00
parent 47a4d93403
commit 5503ff28c3

View file

@ -67,8 +67,7 @@ std::string DisassembleAArch64([[maybe_unused]] u32 instruction, [[maybe_unused]
char buffer[80];
size_t inst_size = LLVMDisasmInstruction(llvm_ctx, (u8*)&instruction, sizeof(instruction), pc, buffer, sizeof(buffer));
ASSERT(inst_size);
result = buffer;
result = inst_size > 0 ? buffer : "<invalid instruction>";
result += '\n';
LLVMDisasmDispose(llvm_ctx);