mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +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 {
|
let start = match start {
|
||||||
Bound::Included(lo) => lo,
|
Bound::Included(lo) => lo,
|
||||||
Bound::Excluded(lo) => lo + 1,
|
Bound::Excluded(lo) => lo.checked_add(1)?,
|
||||||
Bound::Unbounded => 0,
|
Bound::Unbounded => 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
let end = match end {
|
let end = match end {
|
||||||
Bound::Included(hi) => hi + 1,
|
Bound::Included(hi) => hi.checked_add(1)?,
|
||||||
Bound::Excluded(hi) => hi,
|
Bound::Excluded(hi) => hi,
|
||||||
Bound::Unbounded => length,
|
Bound::Unbounded => length,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user