summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2002-05-06 12:02:26 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2002-05-06 12:02:26 +0000
commitf4961db4725ea72e31df84d1d7149abbf04f466d (patch)
treec48acd30bb0381301f1f749c124881b78e092f62
parent5498a1aa787cc81f0f22df670a1b554e9fdc8656 (diff)
Nettoyage test inutile
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4773 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--asmrun/signals.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/asmrun/signals.c b/asmrun/signals.c
index 19cb1e072..f948e3d75 100644
--- a/asmrun/signals.c
+++ b/asmrun/signals.c
@@ -450,17 +450,15 @@ static void trap_handler(int sig, int code, struct sigcontext * context)
static char * system_stack_top;
static char sig_alt_stack[SIGSTKSZ];
-static int is_stack_overflow(char * fault_addr, unsigned long in_c_code)
+static int is_stack_overflow(char * fault_addr)
{
struct rlimit limit;
struct sigaction act;
/* Sanity checks:
- faulting address is word-aligned
- - faulting address is within the stack
- - we are not inside C code */
- if (in_c_code == 0 &&
- ((long) fault_addr & (sizeof(long) - 1)) == 0 &&
+ - faulting address is within the stack */
+ if (((long) fault_addr & (sizeof(long) - 1)) == 0 &&
getrlimit(RLIMIT_STACK, &limit) == 0 &&
fault_addr < system_stack_top &&
fault_addr >= system_stack_top - limit.rlim_cur - 0x2000) {
@@ -480,7 +478,7 @@ static int is_stack_overflow(char * fault_addr, unsigned long in_c_code)
#if defined(TARGET_i386) && defined(SYS_linux_elf)
static void segv_handler(int signo, struct sigcontext sc)
{
- if (is_stack_overflow((char *) sc.cr2, 0))
+ if (is_stack_overflow((char *) sc.cr2))
raise_stack_overflow();
}
#endif
@@ -488,7 +486,7 @@ static void segv_handler(int signo, struct sigcontext sc)
#if defined(TARGET_i386) && !defined(SYS_linux_elf)
static void segv_handler(int signo, siginfo_t * info, void * arg)
{
- if (is_stack_overflow((char *) info->si_addr, 0))
+ if (is_stack_overflow((char *) info->si_addr))
raise_stack_overflow();
}
#endif