summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-04-05 21:49:44 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-04-05 21:49:44 +0000
commitc584e317e9d5795129e747c9b0854165e39933f1 (patch)
treeb82013652a2f1e6877ea7a4ab381abb609c3df32 /lib
parent76706013131247121a3a153f378946a0cb0e319c (diff)
downloadllvm-c584e317e9d5795129e747c9b0854165e39933f1.tar.gz
llvm-c584e317e9d5795129e747c9b0854165e39933f1.tar.bz2
llvm-c584e317e9d5795129e747c9b0854165e39933f1.tar.xz
ARM disassembler was erroneously accepting an invalid LSL instruction.
For register-controlled shifts, we should check that the encoding constraint Inst{7} = 0 and Inst{4} = 1 is satisfied. rdar://problem/9237693 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128941 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp b/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
index 9ba4a8d624..786e001127 100644
--- a/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
+++ b/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
@@ -1068,6 +1068,10 @@ static bool DisassembleDPSoRegFrm(MCInst &MI, unsigned Opcode, uint32_t insn,
MI.addOperand(MCOperand::CreateReg(getRegisterEnum(B, ARM::GPRRegClassID,
decodeRm(insn))));
if (Rs) {
+ // If Inst{7} != 0, we should reject this insn as an invalid encoding.
+ if (slice(insn, 7, 7))
+ return false;
+
// Register-controlled shifts: [Rm, Rs, shift].
MI.addOperand(MCOperand::CreateReg(getRegisterEnum(B, ARM::GPRRegClassID,
decodeRs(insn))));