summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-07 10:21:28 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-07 10:21:28 +0000
commitbd1104f3dd583dc51df6f437d6ce2c315c49e6bf (patch)
treedbf43e9bc192c3c1275eeaf157cd5da822fb2f39 /vm_eval.c
parent537ee14ff4cde6b765640a86217b7442090d1e76 (diff)
vm_eval.c: fix misplaced GC guard
* vm_eval.c (vm_call0_body): fix RB_GC_GUARD location (check_funcall_exec): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 3f34810fbb..52cf824a54 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -210,10 +210,11 @@ vm_call0_body(rb_thread_t* th, rb_call_info_t *ci, const VALUE *argv)
{
VALUE new_args = rb_ary_new4(ci->argc, argv);
- RB_GC_GUARD(new_args);
rb_ary_unshift(new_args, ID2SYM(ci->mid));
th->passed_block = ci->blockptr;
- return rb_funcall2(ci->recv, idMethodMissing, ci->argc+1, RARRAY_PTR(new_args));
+ ret = rb_funcall2(ci->recv, idMethodMissing, ci->argc+1, RARRAY_PTR(new_args));
+ RB_GC_GUARD(new_args);
+ return ret;
}
case VM_METHOD_TYPE_OPTIMIZED:
switch (ci->me->def->body.optimize_type) {
@@ -338,11 +339,13 @@ static VALUE
check_funcall_exec(struct rescue_funcall_args *args)
{
VALUE new_args = rb_ary_new4(args->argc, args->argv);
+ VALUE ret;
- RB_GC_GUARD(new_args);
rb_ary_unshift(new_args, args->sym);
- return rb_funcall2(args->recv, idMethodMissing,
+ ret = rb_funcall2(args->recv, idMethodMissing,
args->argc+1, RARRAY_PTR(new_args));
+ RB_GC_GUARD(new_args);
+ return ret;
}
static VALUE