From 691ee91c1a8873777bc0dfa544630f30f7d9379a Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 15 Dec 2012 06:10:04 +0000 Subject: [PATCH] * 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 --- proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;