aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-contrib <robot-contrib@yandex-team.com>2023-04-14 11:22:35 +0300
committerrobot-contrib <robot-contrib@yandex-team.com>2023-04-14 11:22:35 +0300
commit4ca3ea35a05a878e6f223274b9fc093146d7b478 (patch)
tree170a2b57c15d8ba086c99498697aa2221f7841cc
parentdac7d493d11bd4d30e8197e7cee4cae2e4f577c6 (diff)
downloadydb-4ca3ea35a05a878e6f223274b9fc093146d7b478.tar.gz
Update contrib/restricted/fast_float to 4.0.0
-rw-r--r--contrib/restricted/fast_float/README.md2
-rw-r--r--contrib/restricted/fast_float/include/fast_float/parse_number.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/contrib/restricted/fast_float/README.md b/contrib/restricted/fast_float/README.md
index 63c2c8caae..10cd01b041 100644
--- a/contrib/restricted/fast_float/README.md
+++ b/contrib/restricted/fast_float/README.md
@@ -66,7 +66,7 @@ The library seeks to follow the C++17 (see [20.19.3](http://eel.is/c++draft/char
Furthermore, we have the following restrictions:
* We only support `float` and `double` types at this time.
* We only support the decimal format: we do not support hexadecimal strings.
-* For values that are either very large or very small (e.g., `1e9999`), we represent it using the infinity or negative infinity value.
+* For values that are either very large or very small (e.g., `1e9999`), we represent it using the infinity or negative infinity value and the returned `ec` is set to `std::errc::result_out_of_range`.
We support Visual Studio, macOS, Linux, freeBSD. We support big and little endian. We support 32-bit and 64-bit systems.
diff --git a/contrib/restricted/fast_float/include/fast_float/parse_number.h b/contrib/restricted/fast_float/include/fast_float/parse_number.h
index d16a25d709..6e4f6eb833 100644
--- a/contrib/restricted/fast_float/include/fast_float/parse_number.h
+++ b/contrib/restricted/fast_float/include/fast_float/parse_number.h
@@ -214,6 +214,10 @@ from_chars_result from_chars_advanced(const char *first, const char *last,
// then we need to go the long way around again. This is very uncommon.
if(am.power2 < 0) { am = digit_comp<T>(pns, am); }
to_float(pns.negative, am, value);
+ // Test for over/underflow.
+ if ((pns.mantissa != 0 && am.mantissa == 0 && am.power2 == 0) || am.power2 == binary_format<T>::infinite_power()) {
+ answer.ec = std::errc::result_out_of_range;
+ }
return answer;
}