зеркало из https://github.com/github/ruby.git
* proc.c (rb_binding_new_with_cfp): allocate the object after envirionment check.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
2ca5e8eeab
Коммит
691ee91c1a
3
proc.c
3
proc.c
|
@ -313,13 +313,14 @@ VALUE
|
|||
rb_binding_new_with_cfp(rb_thread_t *th, const rb_control_frame_t *src_cfp)
|
||||
{
|
||||
rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, src_cfp);
|
||||
VALUE bindval = binding_alloc(rb_cBinding);
|
||||
VALUE bindval;
|
||||
rb_binding_t *bind;
|
||||
|
||||
if (cfp == 0) {
|
||||
rb_raise(rb_eRuntimeError, "Can't create Binding Object on top of Fiber.");
|
||||
}
|
||||
|
||||
bindval = binding_alloc(rb_cBinding);
|
||||
GetBindingPtr(bindval, bind);
|
||||
bind->env = rb_vm_make_env_object(th, cfp);
|
||||
bind->path = cfp->iseq->location.path;
|
||||
|
|
Загрузка…
Ссылка в новой задаче