/*
* call-seq:
* unbound_proc.bind(Binding) => Proc
*
* Bind an UnboundProc to a Binding. Returns a Proc that has been bound
* to the given binding.
*/
static VALUE unboundproc_bind(VALUE self, VALUE binding)
{
#ifdef RUBY_HAS_YARV
rb_proc_t * p;
GetProcPtr(self, p);
return create_proc(rb_cProc, binding, p->block.iseq);
#else
struct BLOCK * b;
Data_Get_Struct(self, struct BLOCK, b);
/* create_proc will do a security check */
return create_proc(rb_cProc, binding, b->body, b->var);
#endif
}