lang: codegen: fix segfault when serialising selector with unnamed args
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user