mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Detect overflow in proc_macro_server subspan
This commit is contained in:
parent
d2454643e1
commit
b54386ab7a
@ -584,12 +584,12 @@ impl server::Literal for Rustc<'_> {
|
||||
|
||||
let start = match start {
|
||||
Bound::Included(lo) => lo,
|
||||
Bound::Excluded(lo) => lo + 1,
|
||||
Bound::Excluded(lo) => lo.checked_add(1)?,
|
||||
Bound::Unbounded => 0,
|
||||
};
|
||||
|
||||
let end = match end {
|
||||
Bound::Included(hi) => hi + 1,
|
||||
Bound::Included(hi) => hi.checked_add(1)?,
|
||||
Bound::Excluded(hi) => hi,
|
||||
Bound::Unbounded => length,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user