Skip to content

Commit

Permalink
fix(cc/ci): Fix bad error "data type is not expected with initializer".
Browse files Browse the repository at this point in the history
It seems that the function responsible for advancing to the next field
not with the same parent as the given field, produced a bad result in
some cases.
  • Loading branch information
ArthurPV committed Feb 6, 2025
1 parent 0e34e9d commit 1078e23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/cc/ci/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1510,9 +1510,11 @@ get_next_member__CIDeclStructField(const CIDeclStructField *self)
CIDeclStructField *
skip_fields_with_given_parent__CIDeclStructField(CIDeclStructField *self)
{
CIDeclStructField *initial_field = self;
CIDeclStructField *current = self->next;

while (current && has_parent_by_addr__CIDeclStructField(current, self)) {
while (current && has_parent_by_addr__CIDeclStructField(
current, initial_field->parent)) {
current = current->next;
}

Expand Down

0 comments on commit 1078e23

Please sign in to comment.