summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-06-21 02:51:55 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-06-21 02:51:55 +0900
commitd0a7e01d9cc97651ec80012fefa7cf1e378adbce (patch)
tree1369f770f7a7d4ee04bac3720748e3de3cc62986
parentbf1cb87b34af41e8877b8c24e5fc37fc07a0394e (diff)
downloadmruby-d0a7e01d9cc97651ec80012fefa7cf1e378adbce.tar.gz
mruby-d0a7e01d9cc97651ec80012fefa7cf1e378adbce.zip
Should call `ecall()` before callinfo adjustment; fix #3715
-rw-r--r--src/vm.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/vm.c b/src/vm.c
index 324a90a41..43663012e 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -1989,21 +1989,18 @@ RETRY_TRY_BLOCK:
if (!proc->env || !MRB_ENV_STACK_SHARED_P(proc->env)) {
goto L_BREAK_ERROR;
}
+ while (mrb->c->eidx > mrb->c->ci->epos) {
+ ecall(mrb, --mrb->c->eidx);
+ }
/* break from fiber block */
if (mrb->c->ci == mrb->c->cibase && mrb->c->ci->pc) {
struct mrb_context *c = mrb->c;
- while (mrb->c->eidx > 0) {
- ecall(mrb, --mrb->c->eidx);
- }
mrb->c = c->prev;
c->prev = NULL;
ci = mrb->c->ci;
}
if (ci->acc < 0) {
- while (mrb->c->eidx > mrb->c->ci->epos) {
- ecall(mrb, --mrb->c->eidx);
- }
ARENA_RESTORE(mrb, ai);
mrb->c->vmexec = FALSE;
mrb->exc = (struct RObject*)break_new(mrb, proc, v);