summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2015-07-30 16:46:31 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2015-07-30 16:46:31 +0900
commitf0040b537136e8f36ff3a6de2508ca8c7c8974a6 (patch)
treee25980092ec488fa52811c23a3181679027ec0ca /src
parent89ebb0c4f15db5ed0e5e6d0715bfcf4fb0a1beac (diff)
downloadmruby-f0040b537136e8f36ff3a6de2508ca8c7c8974a6.tar.gz
mruby-f0040b537136e8f36ff3a6de2508ca8c7c8974a6.zip
vm: execute ensure without exception at the top of the fiber; fix #2904
Diffstat (limited to 'src')
-rw-r--r--src/vm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vm.c b/src/vm.c
index 765512a34..025b487bc 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -1032,7 +1032,7 @@ RETRY_TRY_BLOCK:
mrb_callinfo *ci = mrb->c->ci;
int n, eidx = ci->eidx;
- for (n=0; n<a && eidx > ci[-1].eidx; n++) {
+ for (n=0; n<a && (ci == mrb->c->cibase || eidx > ci[-1].eidx); n++) {
ecall(mrb, --eidx);
ARENA_RESTORE(mrb, ai);
}