about summary refs log tree commit diff
path: root/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-04-03 11:49:23 +0000
committerGitHub <noreply@github.com>2022-04-03 11:49:23 +0000
commit5b5ca0bd17febc252eb5f4e8d645c1c2ea060279 (patch)
tree7c443e49fe92b2afda322912f23a9e87972359e0 /tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff
parentf6bf7a3e411b90385b796340bd99feff135f9a3a (diff)
parentfeb8ccacba1d4e4ca01a5bd4aed80d4846724d08 (diff)
downloadrust-5b5ca0bd17febc252eb5f4e8d645c1c2ea060279.tar.gz
rust-5b5ca0bd17febc252eb5f4e8d645c1c2ea060279.zip
Merge #11866
11866: fix: Prevent underflow in range conversion  r=Veykril a=skyfmmf

Previously, when line numbers of Rust spans were converted to LSP ranges, they could underflow resulting in very large line numbers. As an underflow is always wrong, prevent it and use 0 instead.

This was noticed when opening an empty file in `src/bin/` of a library crate. In this case rustc produces a span with `"line_start": 0, "line_end": 0` resulting in the underflow.

Co-authored-by: Felix Maurer <felix@felix-maurer.de>
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff')
0 files changed, 0 insertions, 0 deletions