Skip to content

CDRIVER-5641: Fixes for packed_bit edge cases on systems with 32-bit size_t #1904

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

Merged
2 commits merged into from
Mar 11, 2025

Conversation

ghost
Copy link

@ghost ghost commented Mar 7, 2025

Fixes two problems that show up at runtime on 32-bit systems:

  • bson_vector_packed_bit_binary_data_length would overflow while rounding nearly-maximum sizes up to the next complete byte.

    This intermediate calculation has been extended to 64 bits wide even on 32-bit size_t.

  • test_bson_vector_edge_cases_packed_bit did not account for the size_t limit on maximum element count.

    Skipped tests for the real max_representable_elements value on 32-bit. Added new tests for the actual 32-bit edge cases.

@ghost ghost requested a review from mdb-ad March 7, 2025 23:49
@ghost ghost merged commit 136c3db into mongodb:master Mar 11, 2025
40 of 42 checks passed
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant