summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-04-22 11:49:10 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2013-04-22 11:49:10 +0900
commitc633f32b4151e372d96fdbb29eda13103ea56e45 (patch)
treefcfae7d68cd3235a49df167b6bac329f9f816b1a /src
parente889cddf789bbe350109ff08fa6b7e37d9051dbb (diff)
downloadmruby-c633f32b4151e372d96fdbb29eda13103ea56e45.tar.gz
mruby-c633f32b4151e372d96fdbb29eda13103ea56e45.zip
should call ensure before popping callinfo; cancel 8ce1ea84
Diffstat (limited to 'src')
-rw-r--r--src/vm.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/vm.c b/src/vm.c
index fb1a4dde2..d9f2d6d8c 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -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;