mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-23 05:29:53 +00:00
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 =
|
||||
map_get_suppl_info(MI, loongarch_insns);
|
||||
if (!suppl_info)
|
||||
return;
|
||||
|
||||
if (suppl_info->memory_access == CS_AC_INVALID) {
|
||||
// not memory instruction
|
||||
return;
|
||||
|
@ -211,7 +211,7 @@ static DecodeStatus DecodeMR01RegisterClass(MCInst *Inst, uint64_t RegNo,
|
||||
uint64_t Address,
|
||||
const void *Decoder)
|
||||
{
|
||||
if (RegNo > 2)
|
||||
if (RegNo >= ARR_SIZE(MR01DecoderTable))
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = MR01DecoderTable[RegNo];
|
||||
@ -970,7 +970,7 @@ static DecodeStatus readInstructionN(const uint8_t *Bytes, size_t BytesLen,
|
||||
|
||||
*Insn = 0;
|
||||
for (unsigned i = 0; i < InstSize; i++)
|
||||
*Insn |= (Bytes[i] << 8 * i);
|
||||
*Insn |= (uint64_t)(Bytes[i]) << (8 * i);
|
||||
|
||||
*Size = InstSize;
|
||||
return MCDisassembler_Success;
|
||||
|
Loading…
Reference in New Issue
Block a user