[前][次][番号順一覧][スレッド一覧]

ruby-changes:40056

From: nobu <ko1@a...>
Date: Fri, 16 Oct 2015 01:07:01 +0900 (JST)
Subject: [ruby-changes:40056] nobu:r52137 (trunk): proc.c: merge blocks

nobu	2015-10-16 01:06:52 +0900 (Fri, 16 Oct 2015)

  New Revision: 52137

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52137

  Log:
    proc.c: merge blocks
    
    * proc.c (proc_binding): merge blocks in same condition.

  Modified files:
    trunk/proc.c
Index: proc.c
===================================================================
--- proc.c	(revision 52136)
+++ proc.c	(revision 52137)
@@ -2614,6 +2614,7 @@ proc_binding(VALUE self) https://github.com/ruby/ruby/blob/trunk/proc.c#L2614
 	if (IS_METHOD_PROC_IFUNC(ifunc)) {
 	    VALUE method = (VALUE)ifunc->data;
 	    envval = env_clone(envval, method_receiver(method), method_cref(method));
+	    iseq = rb_method_iseq(method);
 	}
 	else {
 	    rb_raise(rb_eArgError, "Can't create Binding from C level Proc");
@@ -2624,17 +2625,6 @@ proc_binding(VALUE self) https://github.com/ruby/ruby/blob/trunk/proc.c#L2625
     GetBindingPtr(bindval, bind);
     bind->env = envval;
 
-    if (RUBY_VM_IFUNC_P(iseq)) {
-	struct vm_ifunc *ifunc = (struct vm_ifunc *)iseq;
-	if (IS_METHOD_PROC_IFUNC(ifunc)) {
-	    VALUE method = (VALUE)ifunc->data;
-	    iseq = rb_method_iseq(method);
-	}
-	else {
-	    iseq = NULL;
-	}
-    }
-
     if (iseq) {
 	bind->path = iseq->body->location.path;
 	bind->first_lineno = FIX2INT(rb_iseq_first_lineno(iseq));

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]