widl: If a variable doesn't have a name provide an autogenerated one.

Otherwise widl crashes while generating a typelib for a structure
with an embedded anonymous union:

typedef struct _s
{
    int type;
    union
    {
        int f;
    };
} s;

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2020-02-14 20:56:21 +08:00 committed by Alexandre Julliard
parent 8d0f8da652
commit 2c501aa750
1 changed files with 3 additions and 0 deletions

View File

@ -1630,6 +1630,9 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var)
unsigned char *namedata;
int var_num = (typeinfo->typeinfo->cElement >> 16) & 0xffff;
if (!var->name)
var->name = gen_name();
chat("add_var_desc(%d, %s)\n", index, var->name);
id = 0x40000000 + index;