Better error-handling for DisassembleThumb2DPModImm() with 2-reg operands where

d==15 is considered illegal.  Return false instead of assert().

llvm-svn: 101852
This commit is contained in:
Johnny Chen 2010-04-20 01:01:57 +00:00
parent 64831c6a4c
commit 2161e9f03b
1 changed files with 4 additions and 1 deletions

View File

@ -1413,7 +1413,10 @@ static bool DisassembleThumb2DPModImm(MCInst &MI, unsigned Opcode,
++OpIdx;
if (TwoReg) {
assert(!NoDstReg && "Internal error");
if (NoDstReg) {
DEBUG(errs() << "Thumb encoding error: d==15 for DPModImm 2-reg instr.\n");
return false;
}
MI.addOperand(MCOperand::CreateReg(getRegisterEnum(B, ARM::GPRRegClassID,
decodeRn(insn))));
++OpIdx;