about summary refs log tree commit diff
path: root/library/std/src/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorLukas Kalbertodt <lukas.kalbertodt@gmail.com>2020-07-19 13:45:51 +0200
committerLukas Kalbertodt <lukas.kalbertodt@gmail.com>2020-07-19 16:11:07 +0200
commitce338046c8b40e3284707d2ab725e9f076592959 (patch)
treef4a43228117ba7ec05951d7e0ae13d8d3b62ee67 /library/std/src/sys/unix/stack_overflow.rs
parent47ea6d90b073ab977cf072e2f5f46d63de532cc6 (diff)
downloadrust-ce338046c8b40e3284707d2ab725e9f076592959.tar.gz
rust-ce338046c8b40e3284707d2ab725e9f076592959.zip
Fix panic message when `RangeFrom` index is out of bounds
Before, the `Range` method was called with `end = slice.len()`.
Unfortunately, because `Range::index` first checks the order of the
indices (start has to be smaller than end), an out of bounds index
leads to `core::slice::slice_index_order_fail` being called. This
prints the message 'slice index starts at 27 but ends at 10', which is
worse than 'index 27 out of range for slice of length 10'. This is not
only useful to normal users reading panic messages, but also for people
inspecting assembly and being confused by `slice_index_order_fail`
calls.
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions