=== modified file 'storage/pbxt/src/thread_xt.cc' --- storage/pbxt/src/thread_xt.cc 2010-09-28 13:05:45 +0000 +++ storage/pbxt/src/thread_xt.cc 2010-12-10 11:21:19 +0000 @@ -515,9 +515,10 @@ if (self->t_jmp_depth > 0 && self->t_jmp_depth <= XT_MAX_JMP) { /* As recommended by Barry: rree the resources before the stack is invalid! */ thr_free_resources(self, self->t_jmp_env[self->t_jmp_depth-1].jb_res_top); - + jmp_buf jb; + memcpy(&jb, &self->t_jmp_env[self->t_jmp_depth-1].jb_buffer, sizeof (jmp_buf)); /* Then do the longjmp: */ - longjmp(self->t_jmp_env[self->t_jmp_depth-1].jb_buffer, 1); + longjmp(jb, 1); } } === modified file 'storage/pbxt/src/thread_xt.h' --- storage/pbxt/src/thread_xt.h 2010-05-05 10:59:57 +0000 +++ storage/pbxt/src/thread_xt.h 2010-12-10 11:09:08 +0000 @@ -413,7 +413,13 @@ #define try_(n) TX_CHK_JMP(); \ (self)->t_jmp_env[(self)->t_jmp_depth].jb_res_top = (self)->t_res_top; \ (self)->t_jmp_env[(self)->t_jmp_depth].jb_call_top = (self)->t_call_top; \ - (self)->t_jmp_depth++; profile_setjmp; if (setjmp((self)->t_jmp_env[(self)->t_jmp_depth-1].jb_buffer)) goto catch_##n; + (self)->t_jmp_depth++; profile_setjmp; \ + { \ + jmp_buf jb; \ + if(setjmp(jb)) \ + goto catch_##n; \ + memcpy(&((self)->t_jmp_env[(self)->t_jmp_depth-1].jb_buffer), &jb, sizeof(jb)); \ + } #define catch_(n) (self)->t_jmp_depth--; goto cont_##n; catch_##n: (self)->t_jmp_depth--; xt_caught(self); #define cont_(n) cont_##n: #define throw_() xt_throw(self)