Skip to content

Commit 3a3e877

Browse files
committed
codedump.c: update OP_DEF output
OP_DEF takes R(a) as a class to define a method, sym(b) as a method name, and R(a+1) as a method body. So we added `(R(a+1))` in the output.
1 parent 6442a01 commit 3a3e877

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/codedump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ codedump(mrb_state *mrb, const mrb_irep *irep, FILE *out)
413413
fprintf(out, "RANGE_EXC\tR%d\n", a);
414414
break;
415415
CASE(OP_DEF, BB):
416-
fprintf(out, "DEF\t\tR%d\t:%s\n", a, mrb_sym_dump(mrb, irep->syms[b]));
416+
fprintf(out, "DEF\t\tR%d\t:%s\t(R%d)\n", a, mrb_sym_dump(mrb, irep->syms[b]),a+1);
417417
break;
418418
CASE(OP_UNDEF, B):
419419
fprintf(out, "UNDEF\t\t:%s\n", mrb_sym_dump(mrb, irep->syms[a]));

0 commit comments

Comments
 (0)