[make sure reading a hole can't be floated forward, create a global jumppoint that aborts the program to use as a fallback, create an error hole that eats its arguments.
John Meacham <john@repetae.net>**20060406015912] hunk ./data/jhc_rts.c 48
+static jmp_buf jhc_uncaught;
hunk ./data/jhc_rts.c 94
-int
-main(int argc, char *argv[])
-{
-#ifndef USE_BOEHM_GC
-        size_t mem_size = 1000000000;
-        while(!jhc_mem) {
-                jhc_mem = malloc(mem_size);
-                mem_size *= 0.80;
-        }
-#ifdef _JHC_PROFILE
-        prof_memstart = jhc_mem;
-#endif
-#endif
-
-        jhc_argc = argc - 1;
-        jhc_argv = argv + 1;
-        jhc_progname = argv[0];
-        setlocale(LC_ALL,"");
-        _amain();
-        jhc_print_profile();
-        return 0;
-}
hunk ./data/jhc_rts.c 116
-#define jhc_setjmp(jb) setjmp(*(jmp_buf *)jb)
-#define jhc_longjmp(jb) longjmp(*(jmp_buf *)jb,1)
+#define jhc_setjmp(jb) sigsetjmp(*(jmp_buf *)jb,0)
+#define jhc_longjmp(jb) siglongjmp(*(jmp_buf *)jb,1)
hunk ./data/jhc_rts.c 120
+int
+main(int argc, char *argv[])
+{
+#ifndef USE_BOEHM_GC
+        size_t mem_size = 1000000000;
+        while(!jhc_mem) {
+                jhc_mem = malloc(mem_size);
+                mem_size *= 0.80;
+        }
+#ifdef _JHC_PROFILE
+        prof_memstart = jhc_mem;
+#endif
+#endif
+
+        jhc_argc = argc - 1;
+        jhc_argv = argv + 1;
+        jhc_progname = argv[0];
+        setlocale(LC_ALL,"");
+        if (sigsetjmp(jhc_uncaught,0))
+                jhc_error("Uncaught Exception");
+        else
+                _amain();
+        jhc_print_profile();
+        return 0;
+}
hunk ./lib/base/Jhc/Hole.hs 9
-module Jhc.Hole(Hole(),newHole,fillHole,readHole) where
+module Jhc.Hole(Hole(),newHole,fillHole,readHole,errorHole) where
hunk ./lib/base/Jhc/Hole.hs 17
-readHole (Hole x) = return x
+readHole (Hole x) = strictReturn x
hunk ./lib/base/Jhc/Hole.hs 23
+-- | hole that can be written to and results discarded. never read this.
+errorHole :: Hole a
+errorHole = Hole undefined
+
+
hunk ./lib/base/Jhc/IO.hs 35
-undefinedIOErrorCont = error "Jhc.IO.undefinedIOErrorCont"
+undefinedIOErrorCont = IOErrorCont errorJumpPoint errorHole
hunk ./lib/base/Jhc/JumpPoint.hs 1
-module Jhc.JumpPoint(JumpPoint(), withJumpPoint__, jumpJumpPoint__) where
+module Jhc.JumpPoint(JumpPoint(), withJumpPoint__, jumpJumpPoint__, errorJumpPoint) where
hunk ./lib/base/Jhc/JumpPoint.hs 22
+-- | jumping to this jumppoint will always abort the program.
+foreign import ccall "&jhc_uncaught" errorJumpPoint :: JumpPoint