Commit 66df0ad0 authored by Kazuki Tsujimoto's avatar Kazuki Tsujimoto

Raise LocalJumpError when returning from top-level

parent e6631bf5
......@@ -1002,6 +1002,10 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
switch (GETARG_B(i)) {
case OP_R_NORMAL:
if (ci == mrb->cibase) {
localjump_error(mrb, "return");
goto L_RAISE;
}
ci = mrb->ci;
break;
case OP_R_BREAK:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment