diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-10-28 23:27:07 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-10-28 23:27:07 +0900 |
| commit | 6316e0c75dc4762a4df0a3ed4f273fc3a039b277 (patch) | |
| tree | bfc89c25cc8230926cb522b3c27e9db8c5ab74ae /src | |
| parent | 92e24f809b75d4b077fcde302b1f7d5cf9bac6bb (diff) | |
| download | mruby-6316e0c75dc4762a4df0a3ed4f273fc3a039b277.tar.gz mruby-6316e0c75dc4762a4df0a3ed4f273fc3a039b277.zip | |
Should clear ensure stack at `OP_RETURN break`; #3715
This is a resurrection of d0a7e01, which is accidentally
removed by 93f5f22; Fix #3715
Diffstat (limited to 'src')
| -rw-r--r-- | src/vm.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -338,13 +338,13 @@ ecall(mrb_state *mrb, int i) ci->target_class = MRB_PROC_TARGET_CLASS(p); env = MRB_PROC_ENV(p); mrb_assert(env); - c->stack = c->stack + p->body.irep->nregs; + c->stack += p->body.irep->nregs; exc = mrb->exc; mrb->exc = 0; if (exc) { mrb_gc_protect(mrb, mrb_obj_value(exc)); } mrb_run(mrb, p, env->stack[0]); - c = mrb->c; + mrb->c = c; c->ci = c->cibase + cioff; if (!mrb->exc) mrb->exc = exc; mrb_gc_arena_restore(mrb, ai); @@ -1981,13 +1981,13 @@ RETRY_TRY_BLOCK: if (MRB_PROC_ENV(proc)->cxt != mrb->c) { goto L_BREAK_ERROR; } + while (mrb->c->eidx > mrb->c->ci->epos) { + ecall_adjust(); + } /* break from fiber block */ if (ci == mrb->c->cibase && ci->pc) { struct mrb_context *c = mrb->c; - while (c->eidx > c->ci->epos) { - ecall_adjust(); - } mrb->c = c->prev; c->prev = NULL; ci = mrb->c->ci; |
