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

-Zvalidate-mir: check that all unwind edges go to cleanup blocks #72959

Closed
jonas-schievink opened this issue Jun 3, 2020 · 2 comments · Fixed by #73133
Closed

-Zvalidate-mir: check that all unwind edges go to cleanup blocks #72959

jonas-schievink opened this issue Jun 3, 2020 · 2 comments · Fixed by #73133
Assignees
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jonas-schievink
Copy link
Contributor

jonas-schievink commented Jun 3, 2020

Blocks that are part of unwinding code always need to marked as cleanup. This seems like an easy thing to check in the validation pass. I believe this would have caught a bug in the generator transform (a pretty long time ago).

This issue has been assigned to @doctorn via this comment.

@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html labels Jun 3, 2020
@RalfJung
Copy link
Member

RalfJung commented Jun 5, 2020

Good point! Moreover, cleanup block terminators should also only jump to cleanup blocks, and other terminators should only jump to non-cleanup blocks. Basically, unwind edges must be the only ones that cross the "cleanup to non-cleanup" boundary.

(Miri is already checking this.)

@doctorn
Copy link
Contributor

doctorn commented Jun 8, 2020

@rustbot claim

@rustbot rustbot self-assigned this Jun 8, 2020
@bors bors closed this as completed in 161a8bf Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants