summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-28 17:30:09 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-28 17:30:09 (GMT)
commit866952300dc14ca2803e64992bee41d59a3c074e (patch)
treece90c007ea501cdbbf79c94109e2e059b649855f /proc.c
parentca264b0a880aa76ff1803c35fcc4b643c101df6e (diff)
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
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/proc.c b/proc.c
index 1ca9751..f01d404 100644
--- a/proc.c
+++ b/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;
}