Hi,

2011/9/7 Jurij Smakov <jurij / wooyd.org>:
> "If the function in which setjmp was called returns, it is no longer possible to safely use longjmp with the corresponding jmp_buf object. This is because the stack frame is invalidated when the function returns. Calling longjmp restores the stack pointer, which═├ecause the function returned═ěould point to a non-existent and potentially overwritten/corrupted stack frame.[4][5]"
>
> I've verified that ruby_setjmp() translates to a simple _setjmp() in preprocessed code, and after calling it the function returns immediately.

Ruby's callcc copies stack to heap, then calls setjmp().  Stack frames
are restored from the copy before longjmp().

-- 
Shugo Maeda