mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 05:00:35 +00:00
Fix a segfault when encoding incomplete structs.
This commit is contained in:
parent
22ccd41164
commit
a208aed6ef
1 changed files with 5 additions and 3 deletions
|
@ -495,14 +495,16 @@ encode_struct (dstring_t *encoding, type_t *type, int level)
|
|||
{
|
||||
symtab_t *strct = type->t.symtab;
|
||||
const char *name ="?";
|
||||
char su = '=';
|
||||
char su = ' ';
|
||||
|
||||
if (type->name) // FIXME
|
||||
name = type->name;
|
||||
if (strct->type == stab_union)
|
||||
if (strct && strct->type == stab_union)
|
||||
su = '-';
|
||||
if (strct && strct->type != stab_union)
|
||||
su = '=';
|
||||
dasprintf (encoding, "{%s%c", name, su);
|
||||
if (level < 2)
|
||||
if (strct && level < 2)
|
||||
encode_struct_fields (encoding, strct, level);
|
||||
dasprintf (encoding, "}");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue