codegen.c: skip `OP_ARGARY` before `super` if the method has no arguments.
MODIFY
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
@@ -2853,6 +2853,7 @@ codegen(codegen_scope *s, node *tree, int val)
if (s2 && s2->ainfo > 0) {
ainfo = s2->ainfo;
}
+ if (ainfo > 0) {
genop_2S(s, OP_ARGARY, cursp(), (ainfo<<4)|(lv & 0xf));
push(); push(); push(); /* ARGARY pushes 3 values at most */
pop(); pop(); pop();
@@ -2866,6 +2867,17 @@ codegen(codegen_scope *s, node *tree, int val)
push();
codegen(s, tree->cdr->cdr, VAL);
}
+ }
+ else {
+ /* block argument */
+ if (tree && tree->cdr && tree->cdr->cdr) {
+ codegen(s, tree->cdr->cdr, VAL);
+ }
+ else {
+ gen_blkmove(s, 0, lv);
+ }
+ n = 0;
+ }
s->sp = sp;
genop_2(s, OP_SUPER, cursp(), n);
if (val) push();

codegen.c: skip `OP_ARGARY` before `super` if the method has no arguments.