Commit 181cafcd authored by Richard Pospesel's avatar Richard Pospesel Committed by Alexandre Julliard

widl: Fail compilation if an incomplete union or enum is used in a remoted field.

parent a58e4cc0
...@@ -2573,10 +2573,15 @@ static void check_field_common(const type_t *container_type, ...@@ -2573,10 +2573,15 @@ static void check_field_common(const type_t *container_type,
type = type_array_get_element_type(type); type = type_array_get_element_type(type);
more_to_do = TRUE; more_to_do = TRUE;
break; break;
case TGT_ENUM:
type = type_get_real_type(type);
if (!type_is_complete(type))
{
error_loc_info(&arg->loc_info, "undefined type declaration \"enum %s\"\n", type->name);
}
case TGT_USER_TYPE: case TGT_USER_TYPE:
case TGT_IFACE_POINTER: case TGT_IFACE_POINTER:
case TGT_BASIC: case TGT_BASIC:
case TGT_ENUM:
case TGT_RANGE: case TGT_RANGE:
/* nothing to do */ /* nothing to do */
break; break;
...@@ -2601,10 +2606,15 @@ static void check_remoting_fields(const var_t *var, type_t *type) ...@@ -2601,10 +2606,15 @@ static void check_remoting_fields(const var_t *var, type_t *type)
if (type_is_complete(type)) if (type_is_complete(type))
fields = type_struct_get_fields(type); fields = type_struct_get_fields(type);
else else
error_loc_info(&var->loc_info, "undefined type declaration %s\n", type->name); error_loc_info(&var->loc_info, "undefined type declaration \"struct %s\"\n", type->name);
} }
else if (type_get_type(type) == TYPE_UNION || type_get_type(type) == TYPE_ENCAPSULATED_UNION) else if (type_get_type(type) == TYPE_UNION || type_get_type(type) == TYPE_ENCAPSULATED_UNION)
fields = type_union_get_cases(type); {
if (type_is_complete(type))
fields = type_union_get_cases(type);
else
error_loc_info(&var->loc_info, "undefined type declaration \"union %s\"\n", type->name);
}
if (fields) LIST_FOR_EACH_ENTRY( field, fields, const var_t, entry ) if (fields) LIST_FOR_EACH_ENTRY( field, fields, const var_t, entry )
if (field->declspec.type) check_field_common(type, type->name, field); if (field->declspec.type) check_field_common(type, type->name, field);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment