Skip to content

Trying to fix switch EOG #1573

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

Merged
merged 1 commit into from
Jun 5, 2024
Merged

Trying to fix switch EOG #1573

merged 1 commit into from
Jun 5, 2024

Conversation

oxisto
Copy link
Member

@oxisto oxisto commented Jun 3, 2024

Not sure, if this really the "correct" solution. @konradweiss should probably have another look at this.

Fixes #1568

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Not sure, if this really the "correct" solution. @konradweiss should probably have another look at this.

Fixes #1568
Copy link

sonarqubecloud bot commented Jun 5, 2024

@konradweiss
Copy link
Collaborator

Yes, this should be the correct fix. When implementing the EOG for the switch statement I thought the assumption that one case always has to match, therefore enforcing the presence of a default if the switches do not map exhaustively.

This means with this PR we accept having an incorrect EOG edge if the cases alone handle all possible values of the expression in the switch but now support switch statements that don't enforce a default if the cases do not cover the expressions value exhaustively.

Copy link
Collaborator

@konradweiss konradweiss left a comment

Choose a reason for hiding this comment

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

This should be an adequate improvement although it adds in incorrect edge if there is no default case but all case: cases exhaustively handle the selector expression.

@oxisto
Copy link
Member Author

oxisto commented Jun 5, 2024

This should be an adequate improvement although it adds in incorrect edge if there is no default case but all case: cases exhaustively handle the selector expression.

Hmm any idea how we can do that?

@oxisto oxisto merged commit e03c9cb into main Jun 5, 2024
3 checks passed
@oxisto oxisto deleted the switch-eog branch June 5, 2024 09:51
oxisto added a commit that referenced this pull request Jun 5, 2024
Not sure, if this really the "correct" solution. @konradweiss should probably have another look at this.

Fixes #1568
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.

Switch without default breaks EOG
2 participants