From: Owen Anderson Date: Fri, 26 Aug 2011 06:19:51 +0000 (+0000) Subject: Fix PR10755 by checking for invalid predicate codes from UNPREDICTABLE t2IT instructi... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9bd655dcde1cfa1b97014e2d8e4f9845f7d474bb;p=oota-llvm.git 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 --- diff --git a/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/lib/Target/ARM/Disassembler/ARMDisassembler.cpp index 0d945fdf591..f1c5ce8bc52 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;