Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ndarray dimension signedness, fix ndarray length overflow (2); add 32bit unit test #3523

Merged
merged 9 commits into from
Jun 9, 2022

Conversation

falbrechtskirchinger
Copy link
Contributor

Replaces #3521.

Closes #3519.

@falbrechtskirchinger
Copy link
Contributor Author

@nlohmann Hm. The automatic detection part is failing spectacularly. Also, the CI image is missing some bits to make this work.
That means there's no other choice than to exclude the 32bit lines from coverage for now. I'll add a flag for enabling the 32bit test instead.

The test can be enabled by setting JSON_32bitTest=ON.
Certain lines are unreachable in 64bit builds.
@falbrechtskirchinger
Copy link
Contributor Author

I've verified that -DJSON_32bitTest=ON does in fact produce a working 32bit executable:

$ cmake ~/projects/json/issue3519-trait -DCMAKE_CXX_COMPILER=g++-12.1.1 -DJSON_MultipleHeaders=ON -DJSON_32bitTest=ON
$ make test-32bit_cpp11
$ file tests/test-32bit_cpp11 
tests/test-32bit_cpp11: ELF 32-bit LSB pie executable, Intel 80386, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
$ ./tests/test-32bit_cpp11
[doctest] doctest version is "2.4.6"
[doctest] run with "--help" for options
===============================================================================
[doctest] test cases:  6 |  6 passed | 0 failed | 0 skipped
[doctest] assertions: 23 | 23 passed | 0 failed |
[doctest] Status: SUCCESS!

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling fc6ac6a on falbrechtskirchinger:issue3519-trait into b6d00d1 on nlohmann:develop.

@falbrechtskirchinger falbrechtskirchinger marked this pull request as ready for review June 8, 2022 13:10
Copy link
Owner

@nlohmann nlohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@nlohmann nlohmann self-assigned this Jun 9, 2022
@nlohmann nlohmann added this to the Release 3.11.0 milestone Jun 9, 2022
@nlohmann nlohmann merged commit 48a102c into nlohmann:develop Jun 9, 2022
@nlohmann
Copy link
Owner

nlohmann commented Jun 9, 2022

Thanks! Let's see whether the fuzzer is satisfied now :)

@falbrechtskirchinger falbrechtskirchinger deleted the issue3519-trait branch June 9, 2022 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when roundtripping BJData
5 participants