Skip to content

Commit

Permalink
With frame-pointers entertrap restores base pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
fabbing committed Feb 22, 2022
1 parent d480c0c commit 0ab111a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ OCaml 4.14.0

### Code generation and optimizations:

- #11031: Exception handlers restore the rbp register when using frame-pointers
on amd64.
(Fabrice Buoro, with help from Stephen Dolan, Tom Kelly and Mark Shinwell,
review by Xavier Leroy)

- #10578: Increase the number of integer registers used for
parameter passing on PowerPC (16 registers) and on s390x (8 registers).
(Xavier Leroy, review by Mark Shinwell)
Expand Down
5 changes: 4 additions & 1 deletion asmcomp/amd64/emit.mlp
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,10 @@ let emit_instr env fallthrough i =
done;
emit_named_text_section env.f.fun_name
| Lentertrap ->
()
if fp then begin
let delta = frame_size env - 16 (* retaddr + rbp *) in
I.lea (mem64 NONE delta RSP) rbp
end;
| Ladjust_trap_depth { delta_traps; } ->
(* each trap occupies 16 bytes on the stack *)
let delta = 16 * delta_traps in
Expand Down

0 comments on commit 0ab111a

Please sign in to comment.