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 nested struct being discarded if parent struct is flagged as partial #78

Merged
merged 1 commit into from
Jul 20, 2024

Conversation

giulianobelinassi
Copy link
Collaborator

When clang detects that a certain struct doesn't need a full definition, i.e. its size is not required, then the flag CompleteDefinitionRequired is set to false. But in the following case:

struct Fts3Table {
  struct Fts3Index {
    int nPrefix;
  } *aIndex;
};

int fts3PrefixParameter(
  const char *zParam,
  int *pnIndex,
  struct Fts3Index **apIndex
){
  int a = sizeof(struct Fts3Index);
  return 0;
}

this results in the nested struct Fts3Index not being output as its parent struct Fts3Table is marked as CompleteDefinitionRequired as false. In such cases we have to force CompleteDefinitionRequired of the parent struct as true so that its inner structs can be output.

Fix #77

When clang detects that a certain struct doesn't need a full definition,
i.e. its size is not required, then the flag CompleteDefinitionRequired
is set to false.  But in the following case:
```
struct Fts3Table {
  struct Fts3Index {
    int nPrefix;
  } *aIndex;
};

int fts3PrefixParameter(
  const char *zParam,
  int *pnIndex,
  struct Fts3Index **apIndex
){
  int a = sizeof(struct Fts3Index);
  return 0;
}
```
this results in the nested struct `Fts3Index` not being output as its
parent struct `Fts3Table` is marked as CompleteDefinitionRequired as
false.  In such cases we have to force CompleteDefinitionRequired of
the parent struct as true so that its inner structs can be output.

Signed-off-by: Giuliano Belinassi <gbelinassi@suse.de>
@giulianobelinassi giulianobelinassi merged commit 6054fa3 into SUSE:main Jul 20, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nested Struct definition ignored.
1 participant