WIP: unsized_locals: refuse to emit incorrect LLVM IR#71417
Closed
RalfJung wants to merge 1 commit intorust-lang:masterfrom
Closed
WIP: unsized_locals: refuse to emit incorrect LLVM IR#71417RalfJung wants to merge 1 commit intorust-lang:masterfrom
RalfJung wants to merge 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
Contributor
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
RalfJung
commented
Apr 22, 2020
| bug!("store_unsized called with a sized value") | ||
| }; | ||
|
|
||
| // FIXME: choose an appropriate alignment, or use dynamic align somehow |
Member
Author
There was a problem hiding this comment.
Looks like back in #51131 someone noticed this, but wasn't aware that this is a soundness issue.
Member
Author
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.
This would be one way to "fix" #71416: by refusing to generate LLVM IR that we know cannot be correct (because it entirely ignores dynamic alignment). Unfortunately it makes some tests fail, because they use unsized_locals in a way that does not fit the pattern recognized by #71170.
@spastorino this is what I meant on Zulip when I asked for some way to ensure that we actually do not emit bad
allocas any more.