1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

proc.c: iseq conditions

* proc.c (rb_block_min_max_arity, rb_mod_define_method): use
  RUBY_VM_NORMAL_ISEQ_P() to check if iseq.

* proc.c (make_curry_proc): IS_METHOD_PROC_ISEQ() includes
  RUBY_VM_IFUNC_P().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-10-15 06:34:31 +00:00
parent 7c4b03e775
commit 1bcc7ebda2

6
proc.c
View file

@ -872,7 +872,7 @@ rb_block_min_max_arity(rb_block_t *block, int *max)
const rb_iseq_t *iseq = block->iseq;
if (iseq) {
if (!RUBY_VM_IFUNC_P(iseq)) {
if (RUBY_VM_NORMAL_ISEQ_P(iseq)) {
return rb_iseq_min_max_arity(iseq, max);
}
else {
@ -1780,7 +1780,7 @@ rb_mod_define_method(int argc, VALUE *argv, VALUE mod)
rb_proc_t *proc;
body = proc_dup(body);
GetProcPtr(body, proc);
if (!RUBY_VM_IFUNC_P(proc->block.iseq)) {
if (RUBY_VM_NORMAL_ISEQ_P(proc->block.iseq)) {
proc->is_lambda = TRUE;
proc->is_from_method = TRUE;
}
@ -2610,7 +2610,7 @@ proc_binding(VALUE self)
bind->env = envval;
if (!RUBY_VM_NORMAL_ISEQ_P(iseq)) {
if (RUBY_VM_IFUNC_P(iseq) && IS_METHOD_PROC_ISEQ(iseq)) {
if (IS_METHOD_PROC_ISEQ(iseq)) {
VALUE method = (VALUE)((struct vm_ifunc *)iseq)->data;
iseq = rb_method_iseq(method);
}