Skip to content

Conversation

catamorphism
Copy link
Contributor

Closes #7999

bors added a commit that referenced this pull request Sep 30, 2013
@bors bors closed this Sep 30, 2013
@bors bors merged commit 60eb04a into rust-lang:master Sep 30, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 21, 2022
Fix bug introduced by rust-lang#9386

rust-lang#9386 introduced a potential out-of-bounds array access. Specifically, a location returned by `local_assignments` could have  [`location.statement_index` equal to `mir.basic_blocks[location.block].statements.len()`](https://github.com/rust-lang/rust-clippy/blob/b8a9a507bf9e3149d287841454842116c72d66c4/clippy_utils/src/mir/mod.rs#L129), in which case the location would refer to the block terminator:
https://github.com/rust-lang/rust-clippy/blob/b8a9a507bf9e3149d287841454842116c72d66c4/clippy_lints/src/dereference.rs#L1204-L1206
I suspect the bug is not triggerable now, because of checks leading up to where it occurs. But a future code change could make it triggerable. Hence, it should be fixed.

r? `@Jarcho`

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests run-pass/issue-3176, issue-3168, pipe-sleep and unit-like-struct-drop-run fail on windows

2 participants