fix: integer parsed as float when EINTR set in errno (#4506)
Some checks are pending
Code scanning - action / CodeQL-Build (push) Waiting to run
macOS / macos-12 (13.1) (push) Waiting to run
macOS / macos-12 (13.2.1) (push) Waiting to run
macOS / macos-12 (13.3.1) (push) Waiting to run
macOS / macos-12 (13.4.1) (push) Waiting to run
macOS / macos-12 (14.0) (push) Waiting to run
macOS / macos-12 (14.0.1) (push) Waiting to run
macOS / macos-12 (14.1) (push) Waiting to run
macOS / macos-13 (14.2) (push) Waiting to run
macOS / macos-13 (14.3) (push) Waiting to run
macOS / macos-13 (14.3.1) (push) Waiting to run
macOS / macos-13 (15.0.1) (push) Waiting to run
macOS / macos-13 (15.1) (push) Waiting to run
macOS / macos-13 (15.2) (push) Waiting to run
macOS / macos-14 (15.3) (push) Waiting to run
macOS / macos-14 (15.4) (push) Waiting to run
macOS / macos-15 (16.0) (push) Waiting to run
macOS / macos-15 (16.1) (push) Waiting to run
macOS / xcode_standards (11) (push) Waiting to run
macOS / xcode_standards (14) (push) Waiting to run
macOS / xcode_standards (17) (push) Waiting to run
macOS / xcode_standards (20) (push) Waiting to run
macOS / xcode_standards (23) (push) Waiting to run
Ubuntu / ci_test_clang (push) Waiting to run
Ubuntu / ci_test_gcc (push) Waiting to run
Ubuntu / ci_static_analysis (ci_cppcheck) (push) Waiting to run
Ubuntu / ci_static_analysis (ci_infer) (push) Waiting to run
Ubuntu / ci_static_analysis (ci_single_binaries) (push) Waiting to run
Ubuntu / ci_static_analysis (ci_test_amalgamation) (push) Waiting to run
Ubuntu / ci_static_analysis (ci_test_single_header) (push) Waiting to run
Ubuntu / ci_static_analysis (ci_test_valgrind) (push) Waiting to run
Ubuntu / ci_static_analysis_ubuntu (ci_cpplint) (push) Waiting to run
Ubuntu / ci_static_analysis_ubuntu (ci_non_git_tests) (push) Waiting to run
Ubuntu / ci_static_analysis_ubuntu (ci_offline_testdata) (push) Waiting to run
Ubuntu / ci_static_analysis_ubuntu (ci_reproducible_tests) (push) Waiting to run
Ubuntu / ci_static_analysis_clang (ci_clang_analyze) (push) Waiting to run
Ubuntu / ci_static_analysis_clang (ci_clang_tidy) (push) Waiting to run
Ubuntu / ci_static_analysis_clang (ci_test_clang_sanitizer) (push) Waiting to run
Ubuntu / ci_cmake_options (ci_cmake_flags) (push) Waiting to run
Ubuntu / ci_cmake_options (ci_test_diagnostics) (push) Waiting to run
Ubuntu / ci_cmake_options (ci_test_legacycomparison) (push) Waiting to run
Ubuntu / ci_cmake_options (ci_test_noexceptions) (push) Waiting to run
Ubuntu / ci_cmake_options (ci_test_noglobaludls) (push) Waiting to run
Ubuntu / ci_cmake_options (ci_test_noimplicitconversions) (push) Waiting to run
Ubuntu / ci_test_coverage (push) Waiting to run
Ubuntu / ci_test_compilers_gcc_old (4.8) (push) Waiting to run
Ubuntu / ci_test_compilers_gcc_old (4.9) (push) Waiting to run
Ubuntu / ci_test_compilers_gcc_old (5) (push) Waiting to run
Ubuntu / ci_test_compilers_gcc_old (6) (push) Waiting to run
Ubuntu / ci_test_compilers_gcc (10) (push) Waiting to run
Ubuntu / ci_test_compilers_gcc (11) (push) Waiting to run
Ubuntu / ci_test_compilers_gcc (12) (push) Waiting to run
Ubuntu / ci_test_compilers_gcc (13) (push) Waiting to run
Ubuntu / ci_test_compilers_gcc (14) (push) Waiting to run
Ubuntu / ci_test_compilers_gcc (7) (push) Waiting to run
Ubuntu / ci_test_compilers_gcc (8) (push) Waiting to run
Ubuntu / ci_test_compilers_gcc (9) (push) Waiting to run
Ubuntu / ci_test_compilers_gcc (latest) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (10) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (11) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (12) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (13) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (14) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (15-bullseye) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (16) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (17) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (18) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (19) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (3.5) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (3.6) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (3.7) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (3.8) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (3.9) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (4) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (5) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (6) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (7) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (8) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (9) (push) Waiting to run
Ubuntu / ci_test_compilers_clang (latest) (push) Waiting to run
Ubuntu / ci_test_compilers (g++-4.8) (push) Waiting to run
Ubuntu / ci_test_standards_gcc (11) (push) Waiting to run
Ubuntu / ci_test_standards_gcc (14) (push) Waiting to run
Ubuntu / ci_test_standards_gcc (17) (push) Waiting to run
Ubuntu / ci_test_standards_gcc (20) (push) Waiting to run
Ubuntu / ci_test_standards_gcc (23) (push) Waiting to run
Ubuntu / ci_test_standards_clang (11, libcxx) (push) Waiting to run
Ubuntu / ci_test_standards_clang (11, libstdcxx) (push) Waiting to run
Ubuntu / ci_test_standards_clang (14, libcxx) (push) Waiting to run
Ubuntu / ci_test_standards_clang (14, libstdcxx) (push) Waiting to run
Ubuntu / ci_test_standards_clang (17, libcxx) (push) Waiting to run
Ubuntu / ci_test_standards_clang (17, libstdcxx) (push) Waiting to run
Ubuntu / ci_test_standards_clang (20, libcxx) (push) Waiting to run
Ubuntu / ci_test_standards_clang (20, libstdcxx) (push) Waiting to run
Ubuntu / ci_test_standards_clang (23, libcxx) (push) Waiting to run
Ubuntu / ci_test_standards_clang (23, libstdcxx) (push) Waiting to run
Ubuntu / ci_cuda_example (push) Waiting to run
Ubuntu / ci_icpc (push) Waiting to run
Ubuntu / ci_reuse_compliance (push) Waiting to run
Ubuntu / ci_test_documentation (ci_test_api_documentation) (push) Waiting to run
Ubuntu / ci_test_documentation (ci_test_examples) (push) Waiting to run
Windows / mingw (x64) (push) Waiting to run
Windows / mingw (x86) (push) Waiting to run
Windows / msvc2019 (Win32, Debug) (push) Waiting to run
Windows / msvc2019 (Win32, Release) (push) Waiting to run
Windows / msvc2019 (x64, Debug) (push) Waiting to run
Windows / msvc2019 (x64, Release) (push) Waiting to run
Windows / msvc2019_latest (push) Waiting to run
Windows / msvc2022 (Win32, Debug) (push) Waiting to run
Windows / msvc2022 (Win32, Release) (push) Waiting to run
Windows / msvc2022 (x64, Debug) (push) Waiting to run
Windows / msvc2022 (x64, Release) (push) Waiting to run
Windows / msvc2022_latest (push) Waiting to run
Windows / clang (11) (push) Waiting to run
Windows / clang (12) (push) Waiting to run
Windows / clang (13) (push) Waiting to run
Windows / clang (14) (push) Waiting to run
Windows / clang (15) (push) Waiting to run
Windows / clang-cl-11 (Win32) (push) Waiting to run
Windows / clang-cl-11 (x64) (push) Waiting to run

* fix: integer parsed as float when EINTR set in errno

* chore: make amalgamate

* chore: make pretty

---------

Co-authored-by: Stuart Gorman <Stuart.Gorman@kallipr.com>
This commit is contained in:
Stuart Gorman 2024-11-21 22:09:29 +10:00 committed by GitHub
parent 378e091795
commit f9f8c07792
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -1256,7 +1256,7 @@ scan_number_done:
// we checked the number format before
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
if (errno == 0)
if (errno != ERANGE)
{
value_unsigned = static_cast<number_unsigned_t>(x);
if (value_unsigned == x)
@ -1272,7 +1272,7 @@ scan_number_done:
// we checked the number format before
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
if (errno == 0)
if (errno != ERANGE)
{
value_integer = static_cast<number_integer_t>(x);
if (value_integer == x)

View File

@ -8725,7 +8725,7 @@ scan_number_done:
// we checked the number format before
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
if (errno == 0)
if (errno != ERANGE)
{
value_unsigned = static_cast<number_unsigned_t>(x);
if (value_unsigned == x)
@ -8741,7 +8741,7 @@ scan_number_done:
// we checked the number format before
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
if (errno == 0)
if (errno != ERANGE)
{
value_integer = static_cast<number_integer_t>(x);
if (value_integer == x)