revert runtime file.
[repair.git] / Repair / RepairInterpreter / catcherror.c
1 #include <stdlib.h>
2 #include "catcherror.h"
3
4 struct StackElement * stackptr=NULL;
5
6 void handler(int signal) {
7   jmp_buf *jb=(jmp_buf *)popstack(&stackptr);
8   if (jb==NULL) {
9     printf("Signal %d\n",signal);
10     exit(-1);
11   }
12   longjmp(*jb,1);
13 }
14
15 void installhandlers() {
16   signal(SIGSEGV,&handler);
17   signal(SIGFPE,&handler);
18 }