Skip to content

assertion failed: offset < min_length in GVN #118992

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

Closed
saethlin opened this issue Dec 15, 2023 · 0 comments · Fixed by #119052
Closed

assertion failed: offset < min_length in GVN #118992

saethlin opened this issue Dec 15, 2023 · 0 comments · Fixed by #119052
Labels
A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@saethlin
Copy link
Member

saethlin commented Dec 15, 2023

fn main() {
    let slf = "f".as_bytes();
    let _n = slf[slf.len() - 2];
}

Compile with

-Zmir-opt-level=1 -Zmir-enable-passes=+GVN -Zinline-mir
@saethlin saethlin added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-mir-opt Area: MIR optimizations labels Dec 15, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 15, 2023
@saethlin saethlin added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Dec 15, 2023
@saethlin saethlin changed the title assertion failed: offset < min_length in GVN when building b64 assertion failed: offset < min_length in GVN Dec 17, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 17, 2023
…piler-errors

Avoid overflow in GVN constant indexing.

Fixes rust-lang#118992
Fixes rust-lang#119008
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Dec 17, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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.

2 participants