-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Avoid overflow in GVN constant indexing. #119052
Conversation
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
from_end: false, | ||
}; | ||
projection.to_mut()[i] = | ||
ProjectionElem::ConstantIndex { offset, min_length, from_end: false }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why ConstantIndex
stores min_length
instead of, e.g., the "max index" of the last value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I guess it doesn't make sense to index at usize::MAX
anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
min_length
comes from slice match. I supposed it's easier to compute from the length of the pattern.
@bors r+ rollup |
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#118880 (More expressions correctly are marked to end with curly braces) - rust-lang#118928 (fix: Overlapping spans in delimited meta-vars) - rust-lang#119022 (Remove unnecessary constness from ProjectionCandidate) - rust-lang#119052 (Avoid overflow in GVN constant indexing.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#119052 - cjgillot:gvn-index-overflow, r=compiler-errors Avoid overflow in GVN constant indexing. Fixes rust-lang#118992 Fixes rust-lang#119008
Fixes #118992
Fixes #119008