mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
Fix a LDRT/LDRBT decoding bug where for Encoding A2, if Inst{4} != 0, we should reject the instruction
as invalid. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128734 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1106,6 +1106,14 @@ static bool DisassembleLdStFrm(MCInst &MI, unsigned Opcode, uint32_t insn,
|
||||
MI.addOperand(MCOperand::CreateImm(Offset));
|
||||
OpIdx += 1;
|
||||
} else {
|
||||
// The opcode ARM::LDRT actually corresponds to both Encoding A1 and A2 of
|
||||
// A8.6.86 LDRT. So if Inst{4} != 0 while Inst{25} (getIBit(insn)) == 1,
|
||||
// we should reject this insn as invalid.
|
||||
//
|
||||
// Ditto for LDRBT.
|
||||
if ((Opcode == ARM::LDRT || Opcode == ARM::LDRBT) && (slice(insn,4,4) == 1))
|
||||
return false;
|
||||
|
||||
// Disassemble the offset reg (Rm), shift type, and immediate shift length.
|
||||
MI.addOperand(MCOperand::CreateReg(getRegisterEnum(B, ARM::GPRRegClassID,
|
||||
decodeRm(insn))));
|
||||
|
Reference in New Issue
Block a user