From 44a4945e5c3532dfaccbad3f23622464f0173691 Mon Sep 17 00:00:00 2001 From: "Rong \"Mantle\" Bao" Date: Sat, 6 Sep 2025 14:29:28 +0800 Subject: [MIPS] Mark `jalr[.hb] $zero, $ra` as a return instruction --- arch/mips/il.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'arch/mips/il.cpp') diff --git a/arch/mips/il.cpp b/arch/mips/il.cpp index bfbfeeed..5700acbc 100644 --- a/arch/mips/il.cpp +++ b/arch/mips/il.cpp @@ -1430,7 +1430,10 @@ bool GetLowLevelILForInstruction(Architecture* arch, uint64_t addr, LowLevelILFu { operand = 2; } - il.AddInstruction(il.Call(ReadILOperand(il, instr, operand, registerSize(instr.operands[operand]), addrSize, true))); + if (operand == 2 && op1.reg == REG_ZERO && op2.reg == REG_RA) + il.AddInstruction(il.Return(il.Register(addrSize, REG_RA))); + else + il.AddInstruction(il.Call(ReadILOperand(il, instr, operand, registerSize(instr.operands[operand]), addrSize, true))); } break; case MIPS_JR: -- cgit v1.3.1