Skip to content

Commit

Permalink
Merge pull request json-iterator#513 from AllenX2018/fix-issue-510
Browse files Browse the repository at this point in the history
fix issue 510
  • Loading branch information
AllenX2018 committed Nov 18, 2020
2 parents 726ed9d + 9d1a8f8 commit 4b645e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions iter_float.go
Expand Up @@ -288,6 +288,9 @@ non_decimal_loop:
return iter.readFloat64SlowPath()
}
value = (value << 3) + (value << 1) + uint64(ind)
if value > maxFloat64 {
return iter.readFloat64SlowPath()
}
}
}
return iter.readFloat64SlowPath()
Expand Down
1 change: 1 addition & 0 deletions iter_int.go
Expand Up @@ -9,6 +9,7 @@ var intDigits []int8

const uint32SafeToMultiply10 = uint32(0xffffffff)/10 - 1
const uint64SafeToMultiple10 = uint64(0xffffffffffffffff)/10 - 1
const maxFloat64 = 1<<53 - 1

func init() {
intDigits = make([]int8, 256)
Expand Down

0 comments on commit 4b645e4

Please sign in to comment.