Commit 8ce1ea84 authored by Masamitsu MURASE's avatar Masamitsu MURASE

Protect irep of ensure.

parent a5fbaf17
...@@ -1236,6 +1236,12 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) ...@@ -1236,6 +1236,12 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
acc = ci->acc; acc = ci->acc;
pc = ci->pc; pc = ci->pc;
regs = mrb->stack = mrb->stbase + ci->stackidx; regs = mrb->stack = mrb->stbase + ci->stackidx;
{
int idx = eidx;
while (idx > mrb->ci->eidx) {
mrb_gc_protect(mrb, mrb_obj_value(mrb->ensure[--idx]));
}
}
while (eidx > mrb->ci->eidx) { while (eidx > mrb->ci->eidx) {
ecall(mrb, --eidx); ecall(mrb, --eidx);
} }
......
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