Permalink
Browse files

Check call depth when mrb_yield_class() is called; ref #3521

  • Loading branch information...
matz committed Mar 18, 2017
1 parent 75c374c commit 2cbbeba0e091e95bc8456c29f6cab2c36b44a86b
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/vm.c
View
@@ -668,6 +668,9 @@ mrb_yield_with_class(mrb_state *mrb, mrb_value b, mrb_int argc, const mrb_value
if (mrb_nil_p(b)) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "no block given");
}
if (mrb->c->ci - mrb->c->cibase > MRB_FUNCALL_DEPTH_MAX) {
mrb_exc_raise(mrb, mrb_obj_value(mrb->stack_err));
}
p = mrb_proc_ptr(b);
ci = cipush(mrb);
ci->mid = mid;

0 comments on commit 2cbbeba

Please sign in to comment.