Skip to content

Commit

Permalink
Fix mapping for jr $ra which is not a return type when it should be.
Browse files Browse the repository at this point in the history
  • Loading branch information
wargio committed Aug 29, 2024
1 parent 6235f7f commit 997982a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions arch/Mips/MipsMapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@ void Mips_reg_access(const cs_insn *insn, cs_regs regs_read,

void Mips_set_instr_map_data(MCInst *MI)
{
// Fixes for missing groups.
if (MCInst_getOpcode(MI) == Mips_JR) {
unsigned Reg = MCInst_getOpVal(MI, 0);
switch(Reg) {
case MIPS_REG_RA:
case MIPS_REG_RA_64:
add_group(MI, MIPS_GRP_RET);
break;
}
}

map_cs_id(MI, mips_insns, ARR_SIZE(mips_insns));
map_implicit_reads(MI, mips_insns);
map_implicit_writes(MI, mips_insns);
Expand Down

0 comments on commit 997982a

Please sign in to comment.