Skip to content
Permalink
Browse files
Limit ecall() recursion levels; fix #3466
  • Loading branch information
matz committed Mar 4, 2017
1 parent ecee8c5 commit 3b40a2f6b56d9c81b7673cc50121a56ebf7dc8bd
Showing 1 changed file with 3 additions and 0 deletions.
@@ -292,6 +292,9 @@ ecall(mrb_state *mrb, int i)
ptrdiff_t nstk;

if (i<0) return;
if (mrb->c->ci - mrb->c->cibase > MRB_FUNCALL_DEPTH_MAX) {
mrb_exc_raise(mrb, mrb_obj_value(mrb->stack_err));
}
p = mrb->c->ensure[i];
if (!p) return;
if (mrb->c->ci->eidx > i)

0 comments on commit 3b40a2f

Please sign in to comment.