Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions arch/LoongArch/LoongArchMapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions arch/Xtensa/XtensaDisassembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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;
Expand Down