Slide 50
Slide 50 text
✦ Stacks (push/pop) for managing namespaces
✦ One day: Too many pops on the stack — but why?
✦ rb_ensure() guards
push/pop operations
✦ Bug #20655
✦ Continuation (callcc, cont.call)
triggers rb_ensure callback
wrongly
Bugs of MRI (1)
cont.call triggers ensure in C
VALUE
rb_namespace_exec(
const rb_namespace_t *ns,
namespace_exec_func *func, VALUE arg)
{
rb_thread_t *th = GET_THREAD();
namespace_push(th, ns);
return rb_ensure(func, arg, namespace_pop, (VALUE)th);
}
https://bugs.ruby-lang.org/issues/20655