summaryrefslogtreecommitdiffstats
path: root/asmrun/signals.c
diff options
context:
space:
mode:
Diffstat (limited to 'asmrun/signals.c')
-rw-r--r--asmrun/signals.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/asmrun/signals.c b/asmrun/signals.c
index 8870c6fe2..a19c9c643 100644
--- a/asmrun/signals.c
+++ b/asmrun/signals.c
@@ -323,16 +323,15 @@ static void trap_handler(int sig, int code,
struct sigcontext * context, char * address)
{
int * sp;
-
- if (code != ILL_TRAP_FAULT(5)) {
- fprintf(stderr, "Fatal error: illegal instruction, code 0x%x\n", code);
- exit(100);
- }
/* Unblock SIGILL */
sigset_t mask;
sigemptyset(&mask);
sigaddset(&mask, SIGILL);
sigprocmask(SIG_UNBLOCK, &mask, NULL);
+ if (code != ILL_TRAP_FAULT(5)) {
+ fprintf(stderr, "Fatal error: illegal instruction, code 0x%x\n", code);
+ exit(100);
+ }
/* Recover young_ptr and caml_exception_pointer from the %l5 and %l6 regs */
sp = (int *) context->sc_sp;
caml_exception_pointer = (char *) sp[5];