From 3a3e877ae58203ea5f5ed337f0ad00cfdfff60a7 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 29 Jan 2025 15:01:09 +0900 Subject: [PATCH] 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. --- src/codedump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codedump.c b/src/codedump.c index ef916ff2b..945d8445e 100644 --- a/src/codedump.c +++ b/src/codedump.c @@ -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]));