diff options
| author | Rong "Mantle" Bao <webmaster@csmantle.top> | 2025-09-06 14:29:28 +0800 |
|---|---|---|
| committer | Brandon Miller <brandon@vector35.com> | 2025-12-11 15:10:05 -0500 |
| commit | 44a4945e5c3532dfaccbad3f23622464f0173691 (patch) | |
| tree | ac170c8abd90d81dd74cd40d160e92c185aa434c /arch/mips/arch_mips.cpp | |
| parent | 7c0484defff7f1008f62e0181f81e19013531ff1 (diff) | |
[MIPS] Mark `jalr[.hb] $zero, $ra` as a return instruction
Diffstat (limited to 'arch/mips/arch_mips.cpp')
| -rw-r--r-- | arch/mips/arch_mips.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/mips/arch_mips.cpp b/arch/mips/arch_mips.cpp index 6150e578..51a5d411 100644 --- a/arch/mips/arch_mips.cpp +++ b/arch/mips/arch_mips.cpp @@ -332,10 +332,12 @@ protected: result.AddBranch(CallDestination, instr.operands[0].immediate, nullptr, hasBranchDelay); break; - //Jmp to register register value is unknown case MIPS_JALR: case MIPS_JALR_HB: - result.delaySlots = 1; + if (instr.operands[0].reg == REG_ZERO && instr.operands[1].reg == REG_RA) + result.AddBranch(FunctionReturn, 0, nullptr, hasBranchDelay); + else + result.AddBranch(UnresolvedBranch, 0, nullptr, hasBranchDelay); break; case MIPS_BGEZAL: |
