proc.c: merge blocks
* proc.c (proc_binding): merge blocks in same condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
59d0dfcae0
commit
2fda4a5568
12
proc.c
12
proc.c
@ -2614,6 +2614,7 @@ proc_binding(VALUE self)
|
|||||||
if (IS_METHOD_PROC_IFUNC(ifunc)) {
|
if (IS_METHOD_PROC_IFUNC(ifunc)) {
|
||||||
VALUE method = (VALUE)ifunc->data;
|
VALUE method = (VALUE)ifunc->data;
|
||||||
envval = env_clone(envval, method_receiver(method), method_cref(method));
|
envval = env_clone(envval, method_receiver(method), method_cref(method));
|
||||||
|
iseq = rb_method_iseq(method);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rb_raise(rb_eArgError, "Can't create Binding from C level Proc");
|
rb_raise(rb_eArgError, "Can't create Binding from C level Proc");
|
||||||
@ -2624,17 +2625,6 @@ proc_binding(VALUE self)
|
|||||||
GetBindingPtr(bindval, bind);
|
GetBindingPtr(bindval, bind);
|
||||||
bind->env = envval;
|
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) {
|
if (iseq) {
|
||||||
bind->path = iseq->body->location.path;
|
bind->path = iseq->body->location.path;
|
||||||
bind->first_lineno = FIX2INT(rb_iseq_first_lineno(iseq));
|
bind->first_lineno = FIX2INT(rb_iseq_first_lineno(iseq));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user