]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #5129 - JohnTitor:use-checked-sub, r=flip1995
authorbors <bors@rust-lang.org>
Mon, 3 Feb 2020 16:47:25 +0000 (16:47 +0000)
committerbors <bors@rust-lang.org>
Mon, 3 Feb 2020 16:47:25 +0000 (16:47 +0000)
Use `checked_sub` to avoid index out of bounds

(Fixes) #4681 (possibly)

The issue likely occurs due to `lit_snip.len() < suffix.len() + 1`. You can see similar backtrace to change it to `lit_snip.len() - suffix.len() - 1000` or something then run `cargo test --release`.
But I couldn't come up with the test so I'd leave the issue open if we want.

changelog: Fix potential ICE in `misc_early`


Trivial merge