should raise error on return in block in top-level; close #664

parent e48ed9c9
...@@ -1199,6 +1199,10 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) ...@@ -1199,6 +1199,10 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
goto L_RAISE; goto L_RAISE;
} }
ci = mrb->ci = mrb->cibase + e->cioff; ci = mrb->ci = mrb->cibase + e->cioff;
if (ci == mrb->cibase) {
localjump_error(mrb, "return");
goto L_RAISE;
}
break; break;
} }
case OP_R_NORMAL: case OP_R_NORMAL:
......
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