vm: execute ensure at the top of the fiber; fix #2903

This commit is contained in:
Yukihiro "Matz" Matsumoto
2015-07-30 16:45:31 +09:00
parent 5b11d519d8
commit 89ebb0c4f1
+3
View File
@@ -1497,6 +1497,9 @@ RETRY_TRY_BLOCK:
MRB_THROW(prev_jmp);
}
if (ci == mrb->c->cibase) {
while (eidx > 0) {
ecall(mrb, --eidx);
}
if (ci->ridx == 0) {
if (mrb->c == mrb->root_c) {
regs = mrb->c->stack = mrb->c->stbase;