Skip to content

Commit

Permalink
Fix self-contained check for members
Browse files Browse the repository at this point in the history
The external annotation is applied to (struct/union) members in IDL,
so the check for this should be part of the iteration over the members.

Signed-off-by: Dennis Potman <[email protected]>
  • Loading branch information
dpotman authored and eboasson committed Sep 3, 2024
1 parent 14f510d commit ac7e538
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/idlcxx/src/generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ static bool sc_union(const idl_union_t *_union)

const idl_case_t *_case = NULL;
IDL_FOREACH(_case, _union->cases) {
if (!is_selfcontained(_case->type_spec))
if (is_external(_case) || !is_selfcontained(_case->type_spec))
return false;
}

Expand All @@ -549,7 +549,7 @@ static bool sc_struct(const idl_struct_t *str)
{
const idl_member_t *mem = NULL;
IDL_FOREACH(mem, str->members) {
if (!is_selfcontained(mem->type_spec))
if (is_external(mem) || !is_selfcontained(mem->type_spec))
return false;
}

Expand All @@ -575,9 +575,8 @@ bool is_selfcontained(const void *node)
const idl_node_t *parent = ((const idl_node_t*)node)->parent;
assert (idl_is_typedef(parent));
return is_selfcontained(parent);
} else {
return !is_external(node);
}
return true;
}

idl_extensibility_t
Expand Down

0 comments on commit ac7e538

Please sign in to comment.