[qfcc] Use generated tag for reporting errors

Avoids a segfault when the supplied tag is null (often the case when
qfcc defines the struct). Avoids a segfault when other errors cause
problems.
This commit is contained in:
Bill Currie 2023-10-28 08:45:27 +09:00
parent b52b803c2a
commit c6ab5cd0ec

View file

@ -82,7 +82,7 @@ find_tag (ty_meta_e meta, symbol_t *tag, type_t *type)
sym = symtab_lookup (current_symtab, tag_name);
if (sym) {
if (sym->table == current_symtab && sym->type->meta != meta)
error (0, "%s defined as wrong kind of tag", tag->name);
error (0, "%s defined as wrong kind of tag", tag_name);
if (sym->type->meta == meta)
return sym;
}