Nested IT blocks are UNPREDICTABLE. Mark them as such when disassembling them.
llvm-svn: 139736
diff --git a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
index 9d4449a..6b86e41 100644
--- a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
+++ b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
@@ -567,6 +567,10 @@
// code and mask operands so that we can apply them correctly
// to the subsequent instructions.
if (MI.getOpcode() == ARM::t2IT) {
+ // Nested IT blocks are UNPREDICTABLE.
+ if (!ITBlock.empty())
+ return MCDisassembler::SoftFail;
+
// (3 - the number of trailing zeros) is the number of then / else.
unsigned firstcond = MI.getOperand(0).getImm();
unsigned Mask = MI.getOperand(1).getImm();