mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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:
parent
2ca5e8eeab
commit
691ee91c1a
1 changed files with 2 additions and 1 deletions
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue