diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-04-22 11:49:10 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-04-22 11:49:10 +0900 |
| commit | c633f32b4151e372d96fdbb29eda13103ea56e45 (patch) | |
| tree | fcfae7d68cd3235a49df167b6bac329f9f816b1a | |
| parent | e889cddf789bbe350109ff08fa6b7e37d9051dbb (diff) | |
| download | mruby-c633f32b4151e372d96fdbb29eda13103ea56e45.tar.gz mruby-c633f32b4151e372d96fdbb29eda13103ea56e45.zip | |
should call ensure before popping callinfo; cancel 8ce1ea84
| -rw-r--r-- | src/vm.c | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -811,7 +811,8 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) int a = GETARG_A(i); for (n=0; n<a; n++) { - ecall(mrb, --mrb->ci->eidx); + ecall(mrb, mrb->ci->eidx-1); + --mrb->ci->eidx; } mrb_gc_arena_restore(mrb, ai); NEXT; @@ -1283,19 +1284,13 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) /* cannot happen */ break; } + while (eidx > mrb->ci[-1].eidx) { + ecall(mrb, --eidx); + } cipop(mrb); acc = ci->acc; pc = ci->pc; 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) { - ecall(mrb, --eidx); - } if (acc < 0) { mrb->jmp = prev_jmp; return v; |
