summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/Disassembler
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-08-24 22:40:22 +0000
committerOwen Anderson <resistor@mac.com>2011-08-24 22:40:22 +0000
commitf44082091c5517a3275c57a8b58e36987c8227f0 (patch)
treea22eab2d702a8494077a1440a2f7ccaf3694d576 /lib/Target/ARM/Disassembler
parentf8f90f01747b9c7f6c332d8ec12c92fc5158af96 (diff)
downloadllvm-f44082091c5517a3275c57a8b58e36987c8227f0.tar.gz
llvm-f44082091c5517a3275c57a8b58e36987c8227f0.tar.bz2
llvm-f44082091c5517a3275c57a8b58e36987c8227f0.tar.xz
Perform more thorough checking of t2IT mask parameters, which fixes all remaining crashers when disassembling the entire 16-bit instruction space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138507 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/Disassembler')
-rw-r--r--lib/Target/ARM/Disassembler/ARMDisassembler.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
index e22126956e..83a8f80060 100644
--- a/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
+++ b/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
@@ -230,6 +230,8 @@ static DecodeStatus DecodeThumbBLTargetOperand(llvm::MCInst &Inst, unsigned Val,
uint64_t Address, const void *Decoder);
static DecodeStatus DecodeITCond(llvm::MCInst &Inst, unsigned Val,
uint64_t Address, const void *Decoder);
+static DecodeStatus DecodeITMask(llvm::MCInst &Inst, unsigned Val,
+ uint64_t Address, const void *Decoder);
#include "ARMGenDisassemblerTables.inc"
#include "ARMGenInstrInfo.inc"
@@ -3304,3 +3306,14 @@ static DecodeStatus DecodeITCond(llvm::MCInst &Inst, unsigned Cond,
return S;
}
+static DecodeStatus DecodeITMask(llvm::MCInst &Inst, unsigned Mask,
+ uint64_t Address, const void *Decoder) {
+ DecodeStatus S = Success;
+ if (Mask == 0) {
+ Mask = 0x8;
+ CHECK(S, Unpredictable);
+ }
+ Inst.addOperand(MCOperand::CreateImm(Mask));
+ return S;
+}
+