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

Validate value_set element types #3351

Merged
merged 1 commit into from
May 23, 2022
Merged

Conversation

mihaibudiu
Copy link
Contributor

Signed-off-by: Mihai Budiu [email protected]
Fixes #3346

@mihaibudiu mihaibudiu requested a review from fruffy May 23, 2022 20:46
@@ -1414,6 +1414,15 @@ const IR::Node* TypeInference::postorder(IR::P4ValueSet* decl) {
if (errs)
return nullptr;
}
if (!canon->is<IR::Type_Newtype>() &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check seems a little awkward, what is the common characteristic of these types? That they have a fixed width?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Headers may have fixed widths too, but are not allowed.

@mihaibudiu mihaibudiu merged commit 6d16a18 into p4lang:main May 23, 2022
@mihaibudiu mihaibudiu deleted the issue3346 branch May 23, 2022 21:58
github-sajan pushed a commit to github-sajan/p4c that referenced this pull request May 26, 2022
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.

value_set<int> is accepted
2 participants