diff options
| author | Alain Frisch <alain@frisch.fr> | 2013-10-18 15:14:20 +0000 |
|---|---|---|
| committer | Alain Frisch <alain@frisch.fr> | 2013-10-18 15:14:20 +0000 |
| commit | 65adee45603e03a8670d4a8511ba8d8d7d92bd28 (patch) | |
| tree | a54b91931e282c935ff37413b5e7c3003de807d5 /asmrun | |
| parent | d99bb72ca7b4b473a44025a0721dc550ab3b703d (diff) | |
| download | ocaml-65adee45603e03a8670d4a8511ba8d8d7d92bd28.tar.gz | |
Fix Out_of_memory/Stack_overflow.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14237 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'asmrun')
| -rw-r--r-- | asmrun/amd64.S | 2 | ||||
| -rw-r--r-- | asmrun/fail.c | 19 |
2 files changed, 6 insertions, 15 deletions
diff --git a/asmrun/amd64.S b/asmrun/amd64.S index 694869fc69..75763d3380 100644 --- a/asmrun/amd64.S +++ b/asmrun/amd64.S @@ -603,7 +603,7 @@ CFI_ENDPROC backtrace anyway. */ FUNCTION(G(caml_stack_overflow)) - LEA_VAR(caml_bucket_Stack_overflow, %rax) + LEA_VAR(caml_exn_Stack_overflow, %rax) movq %r14, %rsp /* cut the stack */ popq %r14 /* recover previous exn handler */ ret /* jump to handler's code */ diff --git a/asmrun/fail.c b/asmrun/fail.c index 119925492e..40359d4718 100644 --- a/asmrun/fail.c +++ b/asmrun/fail.c @@ -41,10 +41,9 @@ extern caml_generated_constant caml_exn_Sys_blocked_io, caml_exn_Stack_overflow, caml_exn_Assert_failure, - caml_exn_Undefined_recursive_module; -extern caml_generated_constant - caml_bucket_Out_of_memory, - caml_bucket_Stack_overflow; + caml_exn_Undefined_recursive_module, + caml_exn_Out_of_memory, + caml_exn_Stack_overflow; /* Exception raising */ @@ -118,22 +117,14 @@ void caml_invalid_argument (char const *msg) caml_raise_with_string((value) caml_exn_Invalid_argument, msg); } -/* To raise [Out_of_memory], we can't use [caml_raise_constant], - because it allocates and we're out of memory... - We therefore use a statically-allocated bucket constructed - by the ocamlopt linker. - This works OK because the exception value for [Out_of_memory] is also - statically allocated out of the heap. - The same applies to Stack_overflow. */ - void caml_raise_out_of_memory(void) { - caml_raise((value) &caml_bucket_Out_of_memory); + caml_raise_constant((value) caml_exn_Out_of_memory); } void caml_raise_stack_overflow(void) { - caml_raise((value) &caml_bucket_Stack_overflow); + caml_raise_constant((value) caml_exn_Stack_overflow); } void caml_raise_sys_error(value msg) |
