diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-10-20 03:59:13 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-10-20 03:59:13 +0900 |
| commit | 89a18e4f22de80b836f9d6c3167d71b7078a31bb (patch) | |
| tree | e16221399143312f3974d48d269c9bcc300195ce /src/vm.c | |
| parent | 9bb6f0b3314d438e93ec79ae763ac57a559284bc (diff) | |
| download | mruby-89a18e4f22de80b836f9d6c3167d71b7078a31bb.tar.gz mruby-89a18e4f22de80b836f9d6c3167d71b7078a31bb.zip | |
unexpect break/next/redo/retry should raise LocalJumpError
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1817,8 +1817,14 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) CASE(OP_ERR) { /* Bx raise RuntimeError with message Lit(Bx) */ mrb_value msg = pool[GETARG_Bx(i)]; - mrb_value exc = mrb_exc_new3(mrb, E_RUNTIME_ERROR, msg); + mrb_value exc; + if (GETARG_A(i) == 0) { + exc = mrb_exc_new3(mrb, E_RUNTIME_ERROR, msg); + } + else { + exc = mrb_exc_new3(mrb, E_LOCALJUMP_ERROR, msg); + } mrb->exc = (struct RObject*)mrb_object(exc); goto L_RAISE; } |
