summaryrefslogtreecommitdiff
path: root/asmrun/i386.S
diff options
context:
space:
mode:
Diffstat (limited to 'asmrun/i386.S')
-rw-r--r--asmrun/i386.S14
1 files changed, 11 insertions, 3 deletions
diff --git a/asmrun/i386.S b/asmrun/i386.S
index 9d45f6e974..ce05744a79 100644
--- a/asmrun/i386.S
+++ b/asmrun/i386.S
@@ -384,9 +384,17 @@ G(caml_ml_array_bound_error):
ffree %st(5)
ffree %st(6)
ffree %st(7)
- /* Branch to [caml_array_bound_error] */
- movl $ G(caml_array_bound_error), %eax
- jmp G(caml_c_call)
+ /* Record lowest stack address and return address */
+ movl (%esp), %edx
+ movl %edx, G(caml_last_return_address)
+ leal 4(%esp), %edx
+ movl %edx, G(caml_bottom_of_stack)
+ /* For MacOS X: re-align the stack */
+#ifdef SYS_macosx
+ andl $-16, %esp
+#endif
+ /* Branch to [caml_array_bound_error] (never returns) */
+ call G(caml_array_bound_error)
.data
.globl G(caml_system__frametable)