Protect irep of ensure.

This commit is contained in:
Masamitsu MURASE
2013-01-30 20:46:37 +09:00
parent a5fbaf17f7
commit 8ce1ea8437
+6
View File
@@ -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);
} }