Skip to content

Commit

Permalink
Generate CFI directives for RISC-V, continued
Browse files Browse the repository at this point in the history
`Pcfi_adjust` was missing in RISC-V Asmexpand.
  • Loading branch information
bschommer authored and xavierleroy committed Mar 15, 2024
1 parent 545bffb commit 4d8c425
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions riscV/Asmexpand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -676,13 +676,15 @@ let expand_instruction instr =
let extra_sz = if n >= 8 then 0 else align ((8 - n) * wordsize) 16 in
let full_sz = Z.add sz (Z.of_uint extra_sz) in
expand_addptrofs X2 X2 (Ptrofs.repr (Z.neg full_sz));
emit (Pcfi_adjust sz);
expand_storeind_ptr X30 X2 ofs;
let va_ofs =
Z.add full_sz (Z.of_sint ((n - 8) * wordsize)) in
vararg_start_ofs := Some va_ofs;
save_arguments n va_ofs
end else begin
expand_addptrofs X2 X2 (Ptrofs.repr (Z.neg sz));
emit (Pcfi_adjust sz);
expand_storeind_ptr X30 X2 ofs;
vararg_start_ofs := None
end
Expand Down

0 comments on commit 4d8c425

Please sign in to comment.