Commit 06f518b9 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1608 from nanamiwang/vmcrash

Fixed callinfo buffer overflow while calling ensure handlers
parents 882afdea 87a39206
...@@ -1287,10 +1287,12 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int ...@@ -1287,10 +1287,12 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int
mrb->jmp = prev_jmp; mrb->jmp = prev_jmp;
mrb_longjmp(mrb); mrb_longjmp(mrb);
} }
while (eidx > ci[-1].eidx) { if (ci > mrb->c->cibase) {
ecall(mrb, --eidx); while (eidx > ci[-1].eidx) {
ecall(mrb, --eidx);
}
} }
if (ci == mrb->c->cibase) { else if (ci == mrb->c->cibase) {
if (ci->ridx == 0) { if (ci->ridx == 0) {
regs = mrb->c->stack = mrb->c->stbase; regs = mrb->c->stack = mrb->c->stbase;
goto L_STOP; goto L_STOP;
......
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