mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 01:42:54 +03:00
Workaround deliberate overflowing negation in serialize::json.
This commit is contained in:
@@ -1540,7 +1540,7 @@ fn parse_number(&mut self) -> JsonEvent {
|
||||
F64Value(res)
|
||||
} else {
|
||||
if neg {
|
||||
let res = -(res as i64);
|
||||
let res = (res as i64).wrapping_neg();
|
||||
|
||||
// Make sure we didn't underflow.
|
||||
if res > 0 {
|
||||
|
||||
Reference in New Issue
Block a user