diff --git a/lang/codegen/msg.c b/lang/codegen/msg.c index 0a88694..8e2770e 100644 --- a/lang/codegen/msg.c +++ b/lang/codegen/msg.c @@ -122,9 +122,19 @@ static void serialise_selector( b_queue_foreach (&it, &sel->n_arg_labels) { struct ivy_token *arg = b_unbox(struct ivy_token, it.entry, t_entry); + + if (arg->t_type != IVY_TOK_IDENT) { + b_stringstream_addf(out, "0"); + continue; + } + const char *label = arg->t_str; - b_stringstream_addf(out, "%zu%s", strlen(label), label); + if (label) { + b_stringstream_addf(out, "%zu%s", strlen(label), label); + } else { + b_stringstream_addf(out, "0"); + } } b_stringstream_add(out, "E");