Add "no super" check to OP_ARGARY; fix #3610

parent c3961847
......@@ -1514,16 +1514,17 @@ RETRY_TRY_BLOCK:
int lv = (bx>>0)&0xf;
mrb_value *stack;
if (lv == 0) stack = regs + 1;
else {
struct REnv *e = uvenv(mrb, lv-1);
if (!e) {
if (mrb->c->ci->mid == 0 || mrb->c->ci->target_class == NULL) {
mrb_value exc;
L_NOSUPER:
exc = mrb_exc_new_str_lit(mrb, E_NOMETHOD_ERROR, "super called outside of method");
mrb_exc_set(mrb, exc);
goto L_RAISE;
}
if (lv == 0) stack = regs + 1;
else {
struct REnv *e = uvenv(mrb, lv-1);
if (!e) goto L_NOSUPER;
stack = e->stack + 1;
}
if (r == 0) {
......
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