Skip to content
Merged
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
4 changes: 3 additions & 1 deletion arch/riscv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1242,14 +1242,16 @@ impl<D: 'static + RiscVDisassembler + Send + Sync> architecture::Architecture fo
(1, _, _) => il.call(target).append(), // indirect call
(0, _, _) => il.jump(target).append(), // indirect jump
(_, _, _) => {
// store the target in a temporary register so we don't clobber it when rd == rs1
il.set_reg(max_width, llil::Register::Temp(0), target).append();
// indirect jump with storage of next address to non-`ra` register
il.set_reg(
max_width,
Register::from(rd),
il.const_ptr(addr.wrapping_add(inst_len)),
)
.append();
il.jump(target).append();
il.jump(il.reg(max_width, llil::Register::Temp(0))).append();
}
}
}
Expand Down