From 8b1e43211358b509f8ebe4a8b46921be8b4013cd Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Tue, 22 May 2012 21:42:43 +0000 Subject: [PATCH] Integrated a fix for an ARM disassembler crash (0xd 0xd 0xa0 0xf4, or "vld2hs.8 {d0[], d1[]}, [r0]!") llvm-svn: 157289 --- lldb/scripts/llvm.amalgamated.diff | 32 +++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/lldb/scripts/llvm.amalgamated.diff b/lldb/scripts/llvm.amalgamated.diff index 27e1ad3784e2..9419364f027b 100644 --- a/lldb/scripts/llvm.amalgamated.diff +++ b/lldb/scripts/llvm.amalgamated.diff @@ -360,7 +360,33 @@ Index: lib/Target/ARM/Disassembler/ARMDisassembler.cpp break; } -@@ -2837,19 +2887,25 @@ +@@ -2555,7 +2605,6 @@ + unsigned Rm = fieldFromInstruction32(Insn, 0, 4); + unsigned align = fieldFromInstruction32(Insn, 4, 1); + unsigned size = 1 << fieldFromInstruction32(Insn, 6, 2); +- unsigned pred = fieldFromInstruction32(Insn, 22, 4); + align *= 2*size; + + switch (Inst.getOpcode()) { +@@ -2586,16 +2635,11 @@ + return MCDisassembler::Fail; + Inst.addOperand(MCOperand::CreateImm(align)); + +- if (Rm == 0xD) +- Inst.addOperand(MCOperand::CreateReg(0)); +- else if (Rm != 0xF) { ++ if (Rm != 0xD && Rm != 0xF) { + if (!Check(S, DecodeGPRRegisterClass(Inst, Rm, Address, Decoder))) + return MCDisassembler::Fail; + } + +- if (!Check(S, DecodePredicateOperand(Inst, pred, Address, Decoder))) +- return MCDisassembler::Fail; +- + return S; + } + +@@ -2837,19 +2881,25 @@ static DecodeStatus DecodeThumbBROperand(llvm::MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder) { @@ -389,7 +415,7 @@ Index: lib/Target/ARM/Disassembler/ARMDisassembler.cpp return MCDisassembler::Success; } -@@ -3162,10 +3218,25 @@ +@@ -3162,10 +3212,25 @@ static DecodeStatus DecodeThumbBLXOffset(llvm::MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder) { @@ -417,7 +443,7 @@ Index: lib/Target/ARM/Disassembler/ARMDisassembler.cpp return MCDisassembler::Success; } -@@ -3271,15 +3342,32 @@ +@@ -3271,15 +3336,32 @@ static DecodeStatus DecodeThumbBCCTargetOperand(llvm::MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder){