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.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-01-29 15:01:09 +09:00
parent 6442a012c8
commit 3a3e877ae5
+1 -1
View File
@@ -413,7 +413,7 @@ codedump(mrb_state *mrb, const mrb_irep *irep, FILE *out)
fprintf(out, "RANGE_EXC\tR%d\n", a);
break;
CASE(OP_DEF, BB):
fprintf(out, "DEF\t\tR%d\t:%s\n", a, mrb_sym_dump(mrb, irep->syms[b]));
fprintf(out, "DEF\t\tR%d\t:%s\t(R%d)\n", a, mrb_sym_dump(mrb, irep->syms[b]),a+1);
break;
CASE(OP_UNDEF, B):
fprintf(out, "UNDEF\t\t:%s\n", mrb_sym_dump(mrb, irep->syms[a]));