[WIDL] Fix type offset calculation for toplevel pointers to non-basetypes.

WIDL used the wrong type information when a pointer to a non-basetype is used as a functions parameter. For example, a 'wchar_t**' would be treated as a 'wchar_t*'.

This patch will be sent upstream.
This commit is contained in:
Eric Kohl 2019-12-15 18:21:11 +01:00
parent bfd8a84865
commit d2540090d3

View file

@ -3639,6 +3639,7 @@ static unsigned int write_type_tfs(FILE *file, int indent,
case TGT_POINTER:
{
enum type_context ref_context;
unsigned int toplevel_offset = *typeformat_offset;
type_t *ref = type_pointer_get_ref(type);
if (context == TYPE_CONTEXT_TOPLEVELPARAM)
@ -3656,7 +3657,7 @@ static unsigned int write_type_tfs(FILE *file, int indent,
offset = write_type_tfs(file, indent, attrs, ref, name, ref_context, typeformat_offset);
if (context == TYPE_CONTEXT_CONTAINER_NO_POINTERS)
return 0;
return offset;
return (context == TYPE_CONTEXT_TOPLEVELPARAM) ? toplevel_offset : offset;
}
offset = write_type_tfs( file, indent, attrs, type_pointer_get_ref(type), name,