ppc: handle invalid CR bits with more than 8 zeros in decodeCRBitMOperand(). bug reported by @felixgr

This commit is contained in:
Nguyen Anh Quynh 2015-06-16 13:59:10 +08:00
parent 3dcad960f6
commit d49ec461ab
1 changed files with 2 additions and 0 deletions

View File

@ -316,6 +316,8 @@ static DecodeStatus decodeCRBitMOperand(MCInst *Inst, uint64_t Imm,
unsigned Zeros = CountTrailingZeros_64(Imm);
// assert(Zeros < 8 && "Invalid CR bit value");
if (Zeros >=8)
return MCDisassembler_Fail;
MCOperand_CreateReg0(Inst, CRRegs[7 - Zeros]);
return MCDisassembler_Success;