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

View File

@ -1540,7 +1540,7 @@ impl<T: Iterator<Item=char>> Parser<T> {
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 {