Skip to content

Commit

Permalink
Workaround deliberate overflowing negation in serialize::json.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed Apr 17, 2015
1 parent e9f892a commit 5e7785c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libserialize/json.rs
Expand Up @@ -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 {
Expand Down

0 comments on commit 5e7785c

Please sign in to comment.