widl: Use typegen_detect_type to determine which types should be written for the pointer description in write_struct_tfs.
Otherwise extra pointers for user types could be written.
This commit is contained in:
parent
06e7eb5c98
commit
1d1d49b6ab
|
@ -2417,16 +2417,18 @@ static unsigned int write_struct_tfs(FILE *file, type_t *type,
|
|||
if (fields) LIST_FOR_EACH_ENTRY(f, fields, const var_t, entry)
|
||||
{
|
||||
type_t *ft = f->type;
|
||||
if (is_ptr(ft))
|
||||
switch (typegen_detect_type(ft, f->attrs, TDT_IGNORE_STRINGS))
|
||||
{
|
||||
case TGT_POINTER:
|
||||
if (is_string_type(f->attrs, ft))
|
||||
write_string_tfs(file, f->attrs, ft, FALSE, f->name, tfsoff);
|
||||
else
|
||||
write_pointer_tfs(file, f->attrs, ft,
|
||||
type_pointer_get_ref(ft)->typestring_offset,
|
||||
FALSE, tfsoff);
|
||||
}
|
||||
else if (type_get_type(ft) == TYPE_ARRAY && type_array_is_decl_as_ptr(ft))
|
||||
break;
|
||||
case TGT_ARRAY:
|
||||
if (type_array_is_decl_as_ptr(ft))
|
||||
{
|
||||
unsigned int offset;
|
||||
|
||||
|
@ -2439,6 +2441,10 @@ static unsigned int write_struct_tfs(FILE *file, type_t *type,
|
|||
offset += 4;
|
||||
write_nonsimple_pointer(file, f->attrs, ft, FALSE, offset, tfsoff);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (type->ptrdesc == *tfsoff)
|
||||
type->ptrdesc = 0;
|
||||
|
|
Loading…
Reference in New Issue