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

post-opt: taint :consistent when statement may raise inconsistently #54219

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

aviatesk
Copy link
Member

When an inconsistent statement doesn’t affect the return value, post-opt analysis will try to refine it to :consistent. However this refinement is invalid if the statement could throw, as :consistent requires consistent termination.

For the time being, this commit implements the most conservative fix. There might be a need to analyze :nothrow in a data-flow sensitive way in the post-opt analysis as like we do for :consistent.

When an inconsistent statement doesn’t affect the return value, post-opt
analysis will try to refine it to `:consistent`. However this refinement
is invalid if the statement could throw, as `:consistent` requires
consistent termination.

For the time being, this commit implements the most conservative fix.
There might be a need to analyze `:nothrow` in a data-flow sensitive
way in the post-opt analysis as like we do for `:consistent`.

- closes #53613
@aviatesk aviatesk added the backport 1.11 Change should be backported to release-1.11 label Apr 23, 2024
@aviatesk aviatesk requested a review from Keno April 23, 2024 16:31
@Keno Keno merged commit 96866cb into master Apr 24, 2024
6 of 8 checks passed
@Keno Keno deleted the avi/53613-2 branch April 24, 2024 20:18
@oscardssmith oscardssmith added bugfix This change fixes an existing bug compiler:effects effect analysis labels Apr 24, 2024
aviatesk added a commit that referenced this pull request Apr 25, 2024
…54219)

When an inconsistent statement doesn’t affect the return value, post-opt
analysis will try to refine it to `:consistent`. However this refinement
is invalid if the statement could throw, as `:consistent` requires
consistent termination.

For the time being, this commit implements the most conservative fix.
There might be a need to analyze `:nothrow` in a data-flow sensitive way
in the post-opt analysis as like we do for `:consistent`.

- closes #53613
@aviatesk aviatesk mentioned this pull request Apr 25, 2024
59 tasks
@aviatesk aviatesk removed the backport 1.11 Change should be backported to release-1.11 label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug compiler:effects effect analysis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

effects mistake with refining inconsistent errors to always-throws
3 participants