Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix self-contained check for aggregated type members #506

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading