Use mrb_get_args instead of direct stack access

This commit is contained in:
Kazuki Tsujimoto
2012-04-28 09:45:56 +09:00
parent 5859a204fe
commit 8ce5893e1a
+2 -1
View File
@@ -53,8 +53,9 @@ mrb_proc_new_cfunc(mrb_state *mrb, mrb_func_t func)
static mrb_value
mrb_proc_initialize(mrb_state *mrb, mrb_value self)
{
mrb_value blk = mrb->stack[mrb->ci->argc+1];
mrb_value blk;
mrb_get_args(mrb, "&", &blk);
if (!mrb_nil_p(blk)) {
*mrb_proc_ptr(self) = *mrb_proc_ptr(blk);
}