fix coverity (#2546)
- cid 514642 - cid 514643 - cid 514644 - cid 514645
This commit is contained in:
parent
1ecfb5b042
commit
abbf32b431
|
@ -180,6 +180,9 @@ void LoongArch_rewrite_memory_operand(MCInst *MI)
|
||||||
|
|
||||||
const loongarch_suppl_info *suppl_info =
|
const loongarch_suppl_info *suppl_info =
|
||||||
map_get_suppl_info(MI, loongarch_insns);
|
map_get_suppl_info(MI, loongarch_insns);
|
||||||
|
if (!suppl_info)
|
||||||
|
return;
|
||||||
|
|
||||||
if (suppl_info->memory_access == CS_AC_INVALID) {
|
if (suppl_info->memory_access == CS_AC_INVALID) {
|
||||||
// not memory instruction
|
// not memory instruction
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -211,7 +211,7 @@ static DecodeStatus DecodeMR01RegisterClass(MCInst *Inst, uint64_t RegNo,
|
||||||
uint64_t Address,
|
uint64_t Address,
|
||||||
const void *Decoder)
|
const void *Decoder)
|
||||||
{
|
{
|
||||||
if (RegNo > 2)
|
if (RegNo >= ARR_SIZE(MR01DecoderTable))
|
||||||
return MCDisassembler_Fail;
|
return MCDisassembler_Fail;
|
||||||
|
|
||||||
unsigned Reg = MR01DecoderTable[RegNo];
|
unsigned Reg = MR01DecoderTable[RegNo];
|
||||||
|
@ -970,7 +970,7 @@ static DecodeStatus readInstructionN(const uint8_t *Bytes, size_t BytesLen,
|
||||||
|
|
||||||
*Insn = 0;
|
*Insn = 0;
|
||||||
for (unsigned i = 0; i < InstSize; i++)
|
for (unsigned i = 0; i < InstSize; i++)
|
||||||
*Insn |= (Bytes[i] << 8 * i);
|
*Insn |= (uint64_t)(Bytes[i]) << (8 * i);
|
||||||
|
|
||||||
*Size = InstSize;
|
*Size = InstSize;
|
||||||
return MCDisassembler_Success;
|
return MCDisassembler_Success;
|
||||||
|
|
Loading…
Reference in New Issue