[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:
Bradley Smith 2014-04-09 14:42:56 +00:00
parent 84998a1fa9
commit dcb9231b8a

View File

@ -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,