summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-01 10:52:52 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-01 10:52:52 (GMT)
commitc90550c251f0c598458d52dd2cbd5445e8d26c65 (patch)
treed8aef428c1f3e22d9f9261ccd402f50f93d4453c /proc.c
parentde2c8c9dbc1e324ce9bb04a01cd209b76f2edc26 (diff)
vm_args.c: fix marking symbol ifunc
* vm_args.c (vm_caller_setup_arg_block): store new ifunc for symbol in control frame proc to be marked. * proc.c (proc_new), vm_insnhelper.c (vm_yield_with_cfunc): block->proc may be an ifunc now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index 98029d0..bd4719d 100644
--- a/proc.c
+++ b/proc.c
@@ -596,6 +596,13 @@ proc_new(VALUE klass, int8_t is_lambda)
procval = block->proc;
if (procval) {
+ if (RUBY_VM_IFUNC_P(procval)) {
+ VALUE newprocval = rb_proc_alloc(klass);
+ rb_proc_t *proc = RTYPEDDATA_DATA(newprocval);
+ proc->block.iseq = (rb_iseq_t *)procval;
+ proc->block.proc = newprocval;
+ return newprocval;
+ }
if (RBASIC(procval)->klass == klass) {
return procval;
}