Skip to content

Commit

Permalink
PR#7417: ensure stack stays 16 bytes aligned
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph-cullmann authored and gasche committed Nov 27, 2016
1 parent 34178a0 commit a10770e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Next version (4.04.1):
- PR#7405, GPR#903: s390x: Fix address of caml_raise_exn in native dynlink modules
(Richard Jones, review by Xavier Leroy)

- MPR#7417, GPR#930: ensure 16 byte stack alignment inside caml_allocN on x86-64
for ocaml build with WITH_FRAME_POINTERS defined
(Christoph Cullmann)

- GPR#912: Fix segfault in Unix.create_process on Windows caused by wrong header
configuration.
(David Allsopp)
Expand Down
5 changes: 4 additions & 1 deletion asmrun/amd64.S
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,15 @@ LBL(103):
CFI_ADJUST(8)
RECORD_STACK_FRAME(8)
#ifdef WITH_FRAME_POINTERS
/* Do we need 16-byte alignment here ? */
/* ensure 16 byte alignment by subq + enter using 16-bytes, PR#7417 */
subq $8, %rsp; CFI_ADJUST (8)
ENTER_FUNCTION
#endif
call LBL(caml_call_gc)
#ifdef WITH_FRAME_POINTERS
/* ensure 16 byte alignment by leave + addq using 16-bytes PR#7417 */
LEAVE_FUNCTION
addq $8, %rsp; CFI_ADJUST (-8)
#endif
popq %rax; CFI_ADJUST(-8) /* recover desired size */
jmp LBL(caml_allocN)
Expand Down

0 comments on commit a10770e

Please sign in to comment.