forked from OSchip/llvm-project
ARM disassembler was erroneously accepting an invalid RSC instruction.
Added checks for regs which should not be 15. rdar://problem/9237734 llvm-svn: 128945
This commit is contained in:
parent
43d47cc397
commit
9da60e016b
|
@ -1072,6 +1072,12 @@ static bool DisassembleDPSoRegFrm(MCInst &MI, unsigned Opcode, uint32_t insn,
|
|||
if (slice(insn, 7, 7))
|
||||
return false;
|
||||
|
||||
// A8.6.3 ADC (register-shifted register)
|
||||
// if d == 15 || n == 15 || m == 15 || s == 15 then UNPREDICTABLE;
|
||||
if (decodeRd(insn) == 15 || decodeRn(insn) == 15 ||
|
||||
decodeRm(insn) == 15 || decodeRs(insn) == 15)
|
||||
return false;
|
||||
|
||||
// Register-controlled shifts: [Rm, Rs, shift].
|
||||
MI.addOperand(MCOperand::CreateReg(getRegisterEnum(B, ARM::GPRRegClassID,
|
||||
decodeRs(insn))));
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
# RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
|
||||
|
||||
# Opcode=261 Name=RSCrs Format=ARM_FORMAT_DPSOREGFRM(5)
|
||||
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# | 0: 0: 1: 1| 0: 0: 0: 0| 1: 1: 1: 0| 0: 1: 0: 0| 1: 1: 1: 1| 1: 0: 0: 0| 0: 1: 0: 1| 1: 1: 1: 1|
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# if d == 15 || n == 15 || m == 15 || s == 15 then UNPREDICTABLE;
|
||||
0x5f 0xf8 0xe4 0x30
|
Loading…
Reference in New Issue