Repository navigation
Fix reading of RNTuple std::bitset with 32 to 48 bits - #430
Merged
Merged
Conversation
Signed-off-by: Sebastian Turner <sebastiant3484@gmail.com>
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull request:
BitsetReaderItemcombined bits withres |= 1 << len. JavaScript shifts are 32 bit signed, so forstd::bitset<N>with 32 <= N <= 48 (still returned as number) bit 31 produced a negative value and higher bits wrapped around.Changes:
modules/rntuple.mjs: useres += 2 ** lenfor the number casedemo/node/rntuple_bitset_test.cxxandrntuple_bitset_test.root: small RNTuple withstd::bitset<32>andstd::bitset<48>fields, written with ROOT 6.38demo/node/rntuple_bitset_test.js: reads all entries and compares with expected values, exits with error on mismatch.github/workflows/jsroot-ci.yml: run the new test in all three jobsFixes:
Wrong values when reading
std::bitsetfields with more than 31 bits and at most 48 bits.Fixes #429