summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-15 06:10:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-15 06:10:04 +0000
commit691ee91c1a8873777bc0dfa544630f30f7d9379a (patch)
treec9bf3ba66ef081d42fe88e1038634a39e71701a0 /proc.c
parent2ca5e8eeababba0469aef7421572e29d81b9bd34 (diff)
* 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
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/proc.c b/proc.c
index dc13c7e418..caa847edd8 100644
--- a/proc.c
+++ b/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;