Skip to content

Commit 5e7785c

Browse files
committed
Workaround deliberate overflowing negation in serialize::json.
1 parent e9f892a commit 5e7785c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libserialize/json.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1540,7 +1540,7 @@ impl<T: Iterator<Item=char>> Parser<T> {
15401540
F64Value(res)
15411541
} else {
15421542
if neg {
1543-
let res = -(res as i64);
1543+
let res = (res as i64).wrapping_neg();
15441544

15451545
// Make sure we didn't underflow.
15461546
if res > 0 {

0 commit comments

Comments
 (0)