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

Ensure we don't generate empty enumerated values #35

Merged
merged 1 commit into from
Oct 23, 2022
Merged

Conversation

Rahix
Copy link
Owner

@Rahix Rahix commented Oct 14, 2022

Make sure we never generate ValueRestriction::Enumerated for an empty list of enumerated values. This will become important when switching to svd-rs as it will refuse accepting such value restrictions.

So far, this situation was only observed for fields where we filter out invalid enumerated values. But the check will also cover hypothetical ATDF files which have an empty list of enumerated values for some field.

Fixes: 62e5b60 ("Drop invalid enumerated values with a warning") from #14

Make sure we never generate `ValueRestriction::Enumerated` for an empty
list of enumerated values.  This will become important when switching to
svd-rs as it will refuse accepting such value restrictions.

So far, this situation was only observed for fields where we filter out
invalid enumerated values.  But the check will also cover hypothetical
ATDF files which have an empty list of enumerated values for some field.

Fixes: 62e5b60 ("Drop invalid enumerated values with a warning")
@Rahix Rahix merged commit f3aa9c5 into main Oct 23, 2022
@Rahix Rahix deleted the empty-enumerated branch October 23, 2022 09:08
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.

1 participant