The ensure clause should keep its ci after its execution; fix
This issue was reported by
@@ -280,12 +280,14 @@ ecall(mrb_state *mrb, int i)
mrb_callinfo *ci;
mrb_value *self = mrb->c->stack;
struct RObject *exc;
+ int cioff;
if (i<0) return;
p = mrb->c->ensure[i];
if (!p) return;
if (mrb->c->ci->eidx > i)
mrb->c->ci->eidx = i;
+ cioff = mrb->c->ci - mrb->c->cibase;
ci = cipush(mrb);
ci->stackent = mrb->c->stack;
ci->mid = ci[-1].mid;
@@ -298,6 +300,7 @@ ecall(mrb_state *mrb, int i)
exc = mrb->exc; mrb->exc = 0;
mrb_run(mrb, p, *self);
mrb->c->ensure[i] = NULL;
+ mrb->c->ci = mrb->c->cibase + cioff;
if (!mrb->exc) mrb->exc = exc;
}
