widl: Fix pointer detection for structures with embedded arrays.
Pointers have priority over every other type, so move the detection to the top of get_struct_type. Fall through from the embedded array detection to the embedded structure handling code so that conformance, variance and pointer presence is inherited from the array's base type.
This commit is contained in:
parent
864d5a38c5
commit
9f0c45b7e7
|
@ -1280,14 +1280,20 @@ static int get_struct_type(var_t *field)
|
|||
while( (t->type == 0) && t->ref )
|
||||
t = t->ref;
|
||||
|
||||
if (is_string_type(field->attrs, field->ptr_level, field->array))
|
||||
if (field->ptr_level > 0)
|
||||
{
|
||||
has_pointer = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_string_type(field->attrs, 0, field->array))
|
||||
{
|
||||
has_conformance = 1;
|
||||
has_variance = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_array_type(field->attrs, field->ptr_level, field->array))
|
||||
if (is_array_type(field->attrs, 0, field->array))
|
||||
{
|
||||
if (field->array && !field->array->is_const)
|
||||
{
|
||||
|
@ -1298,13 +1304,6 @@ static int get_struct_type(var_t *field)
|
|||
}
|
||||
if (is_attr(field->attrs, ATTR_LENGTHIS))
|
||||
has_variance = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (field->ptr_level > 0)
|
||||
{
|
||||
has_pointer = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (t->type)
|
||||
|
|
Loading…
Reference in New Issue