Commit a94ff966 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2800 from carsonmcdonald/proccheck

Verify that proc_lambda is passed a proc
parents 4f6bae61 a797d45e
......@@ -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