ruby-changes:26353
From: nobu <ko1@a...>
Date: Sat, 15 Dec 2012 15:10:14 +0900 (JST)
Subject: [ruby-changes:26353] nobu:r38404 (trunk): * proc.c (rb_binding_new_with_cfp): allocate the object after envirionment check.
nobu 2012-12-15 15:10:04 +0900 (Sat, 15 Dec 2012) New Revision: 38404 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38404 Log: * proc.c (rb_binding_new_with_cfp): allocate the object after envirionment check. Modified files: trunk/proc.c Index: proc.c =================================================================== --- proc.c (revision 38403) +++ proc.c (revision 38404) @@ -313,13 +313,14 @@ VALUE https://github.com/ruby/ruby/blob/trunk/proc.c#L313 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/