We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e8a3449 commit a872917Copy full SHA for a872917
1 file changed
arch/riscv/src/lib.rs
@@ -1255,6 +1255,16 @@ impl<D: RiscVDisassembler> Architecture for RiscVArch<D> {
1255
Op::Jal(j) => {
1256
let target = addr.wrapping_add(j.imm() as i64 as u64);
1257
1258
+ if j.rd().id() != 0 && j.rd().id() != 1 {
1259
+ // Return address stored in non-ra
1260
+ il.set_reg(
1261
+ max_width,
1262
+ Register::from(j.rd()),
1263
+ il.const_ptr(addr.wrapping_add(inst_len)),
1264
+ )
1265
+ .append();
1266
+ }
1267
+
1268
match (j.rd().id(), il.label_for_address(target)) {
1269
(0, Some(mut l)) => il.goto(&mut l),
1270
(0, None) => il.jump(il.const_ptr(target)),
0 commit comments