proc.c: fix GC guard location
* proc.c (proc_call): fix GC guard location after the use of its content. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ca264b0a88
commit
866952300d
3
proc.c
3
proc.c
@ -738,7 +738,7 @@ proc_call(int argc, VALUE *argv, VALUE procval)
|
|||||||
if (RUBY_VM_IFUNC_P(iseq) || iseq->body->param.flags.has_block) {
|
if (RUBY_VM_IFUNC_P(iseq) || iseq->body->param.flags.has_block) {
|
||||||
if (rb_block_given_p()) {
|
if (rb_block_given_p()) {
|
||||||
rb_proc_t *passed_proc;
|
rb_proc_t *passed_proc;
|
||||||
RB_GC_GUARD(passed_procval) = rb_block_proc();
|
passed_procval = rb_block_proc();
|
||||||
GetProcPtr(passed_procval, passed_proc);
|
GetProcPtr(passed_procval, passed_proc);
|
||||||
blockptr = &passed_proc->block;
|
blockptr = &passed_proc->block;
|
||||||
}
|
}
|
||||||
@ -746,6 +746,7 @@ proc_call(int argc, VALUE *argv, VALUE procval)
|
|||||||
|
|
||||||
vret = rb_vm_invoke_proc(GET_THREAD(), proc, argc, argv, blockptr);
|
vret = rb_vm_invoke_proc(GET_THREAD(), proc, argc, argv, blockptr);
|
||||||
RB_GC_GUARD(procval);
|
RB_GC_GUARD(procval);
|
||||||
|
RB_GC_GUARD(passed_procval);
|
||||||
return vret;
|
return vret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user