Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With frame-pointers, exception handlers should restore RBP #11031

Merged
merged 2 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,11 @@ OCaml 4.14.0
Gentoo and Alpine).
(Alex Fan, review by Gabriel Scherer)

- #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)

OCaml 4.13 maintenance branch
-----------------------------

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