1
0
mirror of https://github.com/json-iterator/go.git synced 2025-01-05 12:50:34 +02:00

fix issue 510

This commit is contained in:
AllenX2018 2020-11-17 17:37:55 +08:00
parent 9b79a3e192
commit a3465d79a9
2 changed files with 4 additions and 0 deletions

View File

@ -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()

View File

@ -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)