diff --git a/0001-Parse-large-floats-as-infinity-1349-1353.patch b/0001-Parse-large-floats-as-infinity-1349-1353.patch index 791cd22eec3c3c082c4a2e1fab5a6db8eb066688..28909252066d1137c45b4531848132712bf04e90 100644 --- a/0001-Parse-large-floats-as-infinity-1349-1353.patch +++ b/0001-Parse-large-floats-as-infinity-1349-1353.patch @@ -67,10 +67,10 @@ index a6a3f4e..896bf1b 100644 decoded = value; return true; } -@@ -1660,7 +1660,12 @@ bool OurReader::decodeDouble(Token& token, Value& decoded) { - decoded = value; - return true; - } +@@ -1647,7 +1654,12 @@ bool OurReader::decodeDouble(Token& token, Value& decoded) { + const String buffer(token.start_, token.end_); + IStringStream is(buffer); + if (!(is >> value)) { - return addError( + if (value == std::numeric_limits::max()) + value = std::numeric_limits::infinity(); diff --git a/Fix error whenparses the value of 5E-324 with libc++.patch b/Fix error whenparses the value of 5E-324 with libc++.patch index 2985e697839ee7d7d82436ac730a28d383d38570..62e3c99443418680818c3115edcbc4f120b4605a 100755 --- a/Fix error whenparses the value of 5E-324 with libc++.patch +++ b/Fix error whenparses the value of 5E-324 with libc++.patch @@ -1,8 +1,8 @@ diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp -index f233abb..8f4c544 100755 +index 896bf1b..6624cb0 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp -@@ -1666,6 +1666,12 @@ bool OurReader::decodeDouble(Token& token, Value& decoded) { +@@ -1654,6 +1654,12 @@ bool OurReader::decodeDouble(Token& token, Value& decoded) { const String buffer(token.start_, token.end_); IStringStream is(buffer); if (!(is >> value)) { @@ -12,6 +12,7 @@ index f233abb..8f4c544 100755 + decoded = value; + return true; + } - return addError( - "'" + String(token.start_, token.end_) + "' is not a number.", token); - } + if (value == std::numeric_limits::max()) + value = std::numeric_limits::infinity(); + else if (value == std::numeric_limits::lowest()) + diff --git a/install.py b/install.py index d272710e6e0a7e33c61fe9f0b6afa9a0e59e4ac3..7127b21e26e872344794765ec24830b9b5ee4d18 100755 --- a/install.py +++ b/install.py @@ -51,8 +51,8 @@ def apply_patch(patch_file, target_dir): def do_patch(args, target_dir): patch_file = [ - "Fix error whenparses the value of 5E-324 with libc++.patch", "0001-Parse-large-floats-as-infinity-1349-1353.patch", + "Fix error whenparses the value of 5E-324 with libc++.patch", "0001-Use-default-rather-than-hard-coded-8-for-maximum-agg.patch", "Fix out-of-bounds read.patch" ]