should have protected the return value from GC, even when the method is defined in Ruby; close #1263

This commit is contained in:
Yukihiro "Matz" Matsumoto
2013-05-23 15:14:27 +09:00
parent 2045a35292
commit 93d710117d
+1 -1
View File
@@ -384,7 +384,6 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mr
int ai = mrb_gc_arena_save(mrb);
val = p->body.func(mrb, self);
mrb_gc_arena_restore(mrb, ai);
mrb_gc_protect(mrb, val);
mrb->c->stack = mrb->c->stbase + mrb->c->ci->stackidx;
cipop(mrb);
}
@@ -392,6 +391,7 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mr
val = mrb_run(mrb, p, self);
}
}
mrb_gc_protect(mrb, val);
return val;
}