Commit 26ede31
authored
Rollup merge of rust-lang#5784 - matthiaskrgr:ice_5780, r=phansch
Fix out of bounds access by checking length equality BEFORE accessing by index.
Fixes rust-lang#5780
changelog: fix out of bounds access in unnested_or_patterns lint.
Edit: I did not bother reducing a testcase from `librustc_typeck` crate but I can confirm that with the change the crash no longer occurs.1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
404 | | - | |
| 403 | + | |
| 404 | + | |
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
0 commit comments