mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
Allow the MCDisassembler to return a "soft fail" status code, indicating an instruction that is disassemblable, but invalid. Only used for ARM UNPREDICTABLE instructions at the moment.
Patch by James Molloy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -106,11 +106,12 @@ static void logger(void* arg, const char* log) {
|
||||
// Public interface for the disassembler
|
||||
//
|
||||
|
||||
bool X86GenericDisassembler::getInstruction(MCInst &instr,
|
||||
uint64_t &size,
|
||||
const MemoryObject ®ion,
|
||||
uint64_t address,
|
||||
raw_ostream &vStream) const {
|
||||
MCDisassembler::DecodeStatus
|
||||
X86GenericDisassembler::getInstruction(MCInst &instr,
|
||||
uint64_t &size,
|
||||
const MemoryObject ®ion,
|
||||
uint64_t address,
|
||||
raw_ostream &vStream) const {
|
||||
InternalInstruction internalInstr;
|
||||
|
||||
int ret = decodeInstruction(&internalInstr,
|
||||
@ -123,11 +124,11 @@ bool X86GenericDisassembler::getInstruction(MCInst &instr,
|
||||
|
||||
if (ret) {
|
||||
size = internalInstr.readerCursor - address;
|
||||
return false;
|
||||
return Fail;
|
||||
}
|
||||
else {
|
||||
size = internalInstr.length;
|
||||
return !translateInstruction(instr, internalInstr);
|
||||
return (!translateInstruction(instr, internalInstr)) ? Success : Fail;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user