From 960da4ded4fc165521c26b3dc05078ef25750f03 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 16 May 2022 16:39:56 +0900 Subject: [PATCH] cdump.c: should dump zero symbol (skip) too. Zero symbol in the symbol table now means anonymous arguments. --- src/cdump.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cdump.c b/src/cdump.c index 1c1d6c1ca..79216eab0 100644 --- a/src/cdump.c +++ b/src/cdump.c @@ -194,7 +194,10 @@ sym_var_name(mrb_state *mrb, const char *initname, const char *key, int n) static int cdump_sym(mrb_state *mrb, mrb_sym sym, const char *var_name, int idx, mrb_value init_syms_code, FILE *fp) { - if (sym == 0) return MRB_DUMP_INVALID_ARGUMENT; + if (sym == 0) { + fputs("0,", fp); + return MRB_DUMP_OK; + } mrb_int len; const char *name = mrb_sym_name_len(mrb, sym, &len), *op_name;