mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
RapidJSON: fix bug when parsing NaN, Inf with fraction or exponent parts
Merge Tencent/rapidjson@7c73dd7de7
This commit is contained in:
parent
a6d4a53021
commit
0b568488e3
4
src/thirdparty/rapidjson/reader.h
vendored
4
src/thirdparty/rapidjson/reader.h
vendored
@ -1584,7 +1584,7 @@ private:
|
||||
// Parse frac = decimal-point 1*DIGIT
|
||||
int expFrac = 0;
|
||||
size_t decimalPosition;
|
||||
if (Consume(s, '.')) {
|
||||
if (!useNanOrInf && Consume(s, '.')) {
|
||||
decimalPosition = s.Length();
|
||||
|
||||
if (RAPIDJSON_UNLIKELY(!(s.Peek() >= '0' && s.Peek() <= '9')))
|
||||
@ -1631,7 +1631,7 @@ private:
|
||||
|
||||
// Parse exp = e [ minus / plus ] 1*DIGIT
|
||||
int exp = 0;
|
||||
if (Consume(s, 'e') || Consume(s, 'E')) {
|
||||
if (!useNanOrInf && (Consume(s, 'e') || Consume(s, 'E'))) {
|
||||
if (!useDouble) {
|
||||
d = static_cast<double>(use64bit ? i64 : i);
|
||||
useDouble = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user