diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2012-02-17 10:12:09 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2012-02-17 10:12:09 +0000 |
commit | 339bcbb2c603c22b99cf07daf5f8296d5ea8e940 (patch) | |
tree | 33cb94c04a8463fa83dd81cd2d5f073003b9252a /asmrun/signals_asm.c | |
parent | d6029c574f0914e5bc3fb608bdedb2c3f2c186ab (diff) |
PR#5064, PR#5485: try to ensure that 4K words of stack are available
before calling into C functions, raising a Stack_overflow exception
otherwise. This reduces (but does not eliminate) the risk of
segmentation faults due to stack overflow in C code.
Implemented for i386, amd64 and power, under Linux and MacOSX.
Plus: remove some more stuff related to obsoleted platforms (IA64, SunOS 4).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12159 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'asmrun/signals_asm.c')
-rw-r--r-- | asmrun/signals_asm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/asmrun/signals_asm.c b/asmrun/signals_asm.c index 09bc8abc1..9d42718b8 100644 --- a/asmrun/signals_asm.c +++ b/asmrun/signals_asm.c @@ -46,11 +46,14 @@ extern void caml_win32_overflow_detection(); #endif extern char * caml_code_area_start, * caml_code_area_end; +extern char caml_system__code_begin, caml_system__code_end; #define Is_in_code_area(pc) \ ( ((char *)(pc) >= caml_code_area_start && \ (char *)(pc) <= caml_code_area_end) \ - || (Classify_addr(pc) & In_code_area) ) +|| ((char *)(pc) >= &caml_system__code_begin && \ + (char *)(pc) <= &caml_system__code_end) \ +|| (Classify_addr(pc) & In_code_area) ) /* This routine is the common entry point for garbage collection and signal handling. It can trigger a callback to OCaml code. |