Workaround deliberate overflowing negation in serialize::json.

This commit is contained in:
Felix S. Klock II
2015-04-16 16:48:14 +02:00
parent e9f892acc4
commit 5e7785cabc
+1 -1
View File
@@ -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 {