Commit a797d45e authored by Carson McDonald's avatar Carson McDonald

Verify that proc_lambda is passed a proc

parent 4f6bae61
......@@ -240,6 +240,9 @@ proc_lambda(mrb_state *mrb, mrb_value self)
if (mrb_nil_p(blk)) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "tried to create Proc object without a block");
}
if (mrb_type(blk) != MRB_TT_PROC) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "not a proc");
}
p = mrb_proc_ptr(blk);
if (!MRB_PROC_STRICT_P(p)) {
struct RProc *p2 = (struct RProc*)mrb_obj_alloc(mrb, MRB_TT_PROC, p->c);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment