Fix json parsing i64::MIN, add tests for min and max i64 and u64 values

This commit is contained in:
Erick Tryzelaar
2015-08-03 09:09:44 -07:00
parent 22024a2b71
commit ed6777e59f
2 changed files with 25 additions and 2 deletions
+1 -1
View File
@@ -167,7 +167,7 @@ impl<Iter> Deserializer<Iter>
if pos {
visitor.visit_u64(res)
} else {
let res = -(res as i64);
let res = (res as i64).wrapping_neg();
// Make sure we didn't underflow.
if res > 0 {