In eval.c:

rb_callcc

    if (THREAD_SAVE_CONTEXT(th)) {
		return th->result;
    }

rb_thread_raise

    if (!rb_thread_dead(curr_thread)) {
		if (THREAD_SAVE_CONTEXT(curr_thread)) {
		    return th->thread;
		}
    }

Is that safe? Couldn't th be stored in a register and hence be undefined
when returning from a longjmp in THREAD_SAVE_CONTEXT?

diff -ru6 ruby-1.8.0.old/eval.c rubyx/eval.c
--- ruby-1.8.0.old/eval.c       2003-09-25 19:57:31.000000000 +0200
+++ rubyx/eval.c        2003-09-25 20:26:37.000000000 +0200
@@ -9648,13 +9648,13 @@
 }

 static VALUE
 rb_thread_raise(argc, argv, th)
     int argc;
     VALUE *argv;
-    rb_thread_t th;
+    volatile rb_thread_t th;
 {
     if (rb_thread_dead(th)) return Qnil;
     if (curr_thread == th) {
        rb_f_raise(argc, argv);
     }

@@ -9819,13 +9819,13 @@

 static VALUE
 rb_callcc(self)
     VALUE self;
 {
     volatile VALUE cont;
-    rb_thread_t th;
+    volatile rb_thread_t th;
     struct tag *tag;
     struct RVarmap *vars;

     THREAD_ALLOC(th);
     cont = Data_Wrap_Struct(rb_cCont, thread_mark, thread_free, th);

-- 
 _           _                             
| |__   __ _| |_ ___ _ __ ___   __ _ _ __  
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ 
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
	Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

But what can you do with it?
	-- ubiquitous cry from Linux-user partner