mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
1 changed files with 2 additions and 1 deletions
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 (rb_block_given_p()) {
|
||||
rb_proc_t *passed_proc;
|
||||
RB_GC_GUARD(passed_procval) = rb_block_proc();
|
||||
passed_procval = rb_block_proc();
|
||||
GetProcPtr(passed_procval, passed_proc);
|
||||
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);
|
||||
RB_GC_GUARD(procval);
|
||||
RB_GC_GUARD(passed_procval);
|
||||
return vret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue