mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
[ARM64] Use PStateMapper to ensure that MSRcpsr operands are validated during disassembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205873 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
84998a1fa9
commit
dcb9231b8a
@ -1579,10 +1579,15 @@ static DecodeStatus DecodeSystemCPSRInstruction(llvm::MCInst &Inst,
|
||||
uint64_t op2 = fieldFromInstruction(insn, 5, 3);
|
||||
uint64_t crm = fieldFromInstruction(insn, 8, 4);
|
||||
|
||||
Inst.addOperand(MCOperand::CreateImm((op1 << 3) | op2));
|
||||
uint64_t cpsr_field = (op1 << 3) | op2;
|
||||
|
||||
Inst.addOperand(MCOperand::CreateImm(cpsr_field));
|
||||
Inst.addOperand(MCOperand::CreateImm(crm));
|
||||
|
||||
return Success;
|
||||
bool ValidNamed;
|
||||
(void)ARM64PState::PStateMapper().toString(cpsr_field, ValidNamed);
|
||||
|
||||
return ValidNamed ? Success : Fail;
|
||||
}
|
||||
|
||||
static DecodeStatus DecodeTestAndBranch(llvm::MCInst &Inst, uint32_t insn,
|
||||
|
Loading…
Reference in New Issue
Block a user