aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-08-26 06:19:51 +0000
committerOwen Anderson <resistor@mac.com>2011-08-26 06:19:51 +0000
commit9bd655dcde1cfa1b97014e2d8e4f9845f7d474bb (patch)
treebdfe9244627b8eed78a61892241dae30ebcb4e43 /lib/Target/ARM/Disassembler/ARMDisassembler.cpp
parent8fd13b6de51186ba38c69c4043fc7288a6fc6b8b (diff)
Fix PR10755 by checking for invalid predicate codes from UNPREDICTABLE t2IT instructions when decoding their successors.
This is the last disassembly crash detected by exhaustive Thumb2 instruction space. Major thanks to Chandler Carruth for making this kind of exhaustive testing possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138625 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/Disassembler/ARMDisassembler.cpp')
-rw-r--r--lib/Target/ARM/Disassembler/ARMDisassembler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
index 0d945fdf59..f1c5ce8bc5 100644
--- a/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
+++ b/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
@@ -376,6 +376,8 @@ void ThumbDisassembler::AddThumbPredicate(MCInst &MI) const {
unsigned CC;
if (!ITBlock.empty()) {
CC = ITBlock.back();
+ if (CC == 0xF)
+ CC = ARMCC::AL;
ITBlock.pop_back();
} else
CC = ARMCC::AL;