Skip to content

Commit

Permalink
cdump.c: should dump zero symbol (skip) too.
Browse files Browse the repository at this point in the history
Zero symbol in the symbol table now means anonymous arguments.
  • Loading branch information
matz committed May 16, 2022
1 parent c2648ad commit 960da4d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 960da4d

Please sign in to comment.