diff options
| author | Yukihiro Matz Matsumoto <[email protected]> | 2012-12-17 17:53:33 +0900 |
|---|---|---|
| committer | Yukihiro Matz Matsumoto <[email protected]> | 2012-12-17 17:53:33 +0900 |
| commit | 9de76a71e180afb9803f6c62f86cf452b863157b (patch) | |
| tree | 143c1da59808d142c01b623ea311d0577f18536b | |
| parent | 04b341b791babb64ceb850455169257fbba4ba17 (diff) | |
| download | mruby-9de76a71e180afb9803f6c62f86cf452b863157b.tar.gz mruby-9de76a71e180afb9803f6c62f86cf452b863157b.zip | |
should not ignore exception on top-level; close #635
| -rw-r--r-- | src/vm.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1153,8 +1153,11 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) L_RAISE: mrb_obj_iv_ifnone(mrb, mrb->exc, mrb_intern(mrb, "lastpc"), mrb_voidp_value(pc)); ci = mrb->ci; - eidx = mrb->ci->eidx; - if (ci == mrb->cibase) goto L_STOP; + eidx = ci->eidx; + if (ci == mrb->cibase) { + if (ci->ridx == 0) goto L_STOP; + goto L_RESCUE; + } while (ci[0].ridx == ci[-1].ridx) { cipop(mrb); ci = mrb->ci; @@ -1173,6 +1176,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) break; } } + L_RESCUE: irep = ci->proc->body.irep; pool = irep->pool; syms = irep->syms; |
