Fix change detection in CfgSimplifier::collapse_goto_chain#75076
Merged
bors merged 2 commits intorust-lang:masterfrom Aug 3, 2020
Merged
Fix change detection in CfgSimplifier::collapse_goto_chain#75076bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
Check that the old target is different from the new collapsed one, before concluding that anything changed.
Contributor
|
r? @lcnr (rust_highfive has picked a reviewer for you, use r? to override) |
Contributor
Author
|
r? @oli-obk |
oli-obk
reviewed
Aug 3, 2020
| Terminator { kind: TerminatorKind::Goto { ref mut target }, .. } => target, | ||
| _ => unreachable!(), | ||
| }; | ||
| *changed |= *target != last; |
Contributor
There was a problem hiding this comment.
cc @ecstatic-morse We now have a test case for this!
oli-obk
reviewed
Aug 3, 2020
| @@ -0,0 +1,7 @@ | |||
| // Caused an infinite loop during SimlifyCfg MIR transform previously. | |||
| // | |||
| // build-pass | |||
Contributor
There was a problem hiding this comment.
does this really test this mir pass? don't you also need -Zmir-opt-level=2?
Contributor
Author
There was a problem hiding this comment.
For this test case no additional flags are necessary to reproduce the issue. Unlike the one from #75051 which also needed -Zmir-opt-level=2.
Contributor
|
@bors r+ |
Collaborator
|
📌 Commit 7f9f2ff has been approved by |
Collaborator
Collaborator
|
☀️ Test successful - checks-actions, checks-azure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Check that the old target is different from the new collapsed one, before concluding that anything changed.
Fixes #75074
Fixes #75051