Fix print_insn_detail_tricore and disp fill

This commit is contained in:
billow 2023-04-23 15:14:03 +08:00
parent 2c052afe3c
commit acc8c3fb13
2 changed files with 8 additions and 2 deletions

View File

@ -309,10 +309,13 @@ static inline void fixup_tricore_disp(MCInst *MI, int OpNum, int32_t disp)
{
if (MI->csh->detail != CS_OPT_ON)
return;
if (OpNum <= 0)
return;
cs_tricore *tricore = &MI->flat_insn->detail->tricore;
if (OpNum <= 0) {
fill_tricore_imm(MI, disp);
return;
}
if (tricore->operands[tricore->op_count - 1].type != TRICORE_OP_REG)
return;
fill_mem(tricore, tricore->operands[tricore->op_count - 1].reg, disp);

View File

@ -399,6 +399,9 @@ static void print_details(csh handle, cs_arch arch, cs_mode md, cs_insn *ins)
case CS_ARCH_SH:
print_insn_detail_sh(handle, ins);
break;
case CS_ARCH_TRICORE:
print_insn_detail_tricore(handle, ins);
break;
default: break;
}