diff options
author | Tristan Gingold <tgingold@free.fr> | 2015-09-12 08:57:00 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2015-09-12 08:57:00 +0200 |
commit | 8423924e43087c9b80e8179a49d539decab54886 (patch) | |
tree | 6dbd2aaa5f33c5fea617d47e7bbf89d0738ba928 /src/grt/config/jumps.c | |
parent | 42f4c411641c04da2b8f08f9029e17bfd37206e4 (diff) | |
download | ghdl-8423924e43087c9b80e8179a49d539decab54886.tar.gz ghdl-8423924e43087c9b80e8179a49d539decab54886.tar.bz2 ghdl-8423924e43087c9b80e8179a49d539decab54886.zip |
Tentatively fix win32 support.
Diffstat (limited to 'src/grt/config/jumps.c')
-rw-r--r-- | src/grt/config/jumps.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/grt/config/jumps.c b/src/grt/config/jumps.c index 360ea8089..775225e64 100644 --- a/src/grt/config/jumps.c +++ b/src/grt/config/jumps.c @@ -67,28 +67,24 @@ static int run_env_en; static JMP_BUF run_env; extern void grt_overflow_error (void); +extern void grt_null_access_error (void); #ifdef __APPLE__ #define NEED_SIGFPE_HANDLER #endif -#if defined (__linux__) && defined (__i386__) -#define NEED_SIGSEGV_HANDLER -#endif -#ifdef NEED_SIGFPE_HANDLER static struct sigaction prev_sigfpe_act; -/* Handler for SIGFPE signal, raised in case of overflow (i386). */ +/* Handler for SIGFPE signal. + It is also raised in case of overflow (i386 linux). */ static void grt_overflow_handler (int signo, siginfo_t *info, void *ptr) { grt_overflow_error (); } -#endif -#ifdef NEED_SIGSEGV_HANDLER static struct sigaction prev_sigsegv_act; -/* Linux handler for overflow. This is used only by mcode. */ +/* Posix handler for overflow. This is used only by mcode. */ static void grt_sigsegv_handler (int signo, siginfo_t *info, void *ptr) { #if defined (__linux__) && defined (__i386__) @@ -100,12 +96,11 @@ static void grt_sigsegv_handler (int signo, siginfo_t *info, void *ptr) #endif /* We loose. */ + grt_null_access_error (); } -#endif /* __linux__ && __i386__ */ static void grt_signal_setup (void) { -#ifdef NEED_SIGSEGV_HANDLER { struct sigaction sigsegv_act; @@ -122,7 +117,6 @@ static void grt_signal_setup (void) If the handler is not installed, then some feature are lost. */ sigaction (SIGSEGV, &sigsegv_act, &prev_sigsegv_act); } -#endif #ifdef NEED_SIGFPE_HANDLER { @@ -139,9 +133,7 @@ static void grt_signal_setup (void) static void grt_signal_restore (void) { -#ifdef NEED_SIGSEGV_HANDLER sigaction (SIGSEGV, &prev_sigsegv_act, NULL); -#endif #ifdef NEED_SIGFPE_HANDLER sigaction (SIGFPE, &prev_sigfpe_act, NULL); |