-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 referenced locals exist #73356
Comments
Instructions: Extend the validation pass in
The The method should check that the local exists in |
@rustbot claim |
@yerke FYI, the validation pass currently fails on even libcore until #73175 is merged, so you need to either wait for that, or cherry-pick some commits from there to get it to work. You can test your changes by running |
@jonas-schievink I wanted to double check, running |
It should pass with #73359 applied, but fail on current master. |
@jonas-schievink So your PR fixes this issue (#73356) as well? |
Ah, no, this issue is just about adding additional validation. It shouldn't actually detect any locals that don't exist. So the command should work both before and after implementing this. If it fails after implementing this, something else is going on that we should look into. |
@yerke are you still working on this? |
No, sorry. Didn’t have time for it. Go ahead. |
@rustbot release-assignment |
Would like to work on this, but it seems there is another check, not on the declaration like this one, but on the memory liveness. This should cover the case that the local is not declared (I think), or would it not? rust/compiler/rustc_mir/src/transform/validate.rs Lines 187 to 192 in 1773f60
|
When encountering a
Local
, there must be a correspondingLocalDecl
in the MIR body. If there isn't, later passes can panic due to indexing out of bounds of theLocalDecl
array. The validation pass could detect this problem earlier.The text was updated successfully, but these errors were encountered: