fix: stop invalid chromosome queries from corrupting fRefVec (#23)#53
Open
ZaGrayWolf wants to merge 1 commit intocompiler-research:developfrom
Open
fix: stop invalid chromosome queries from corrupting fRefVec (#23)#53ZaGrayWolf wants to merge 1 commit intocompiler-research:developfrom
ZaGrayWolf wants to merge 1 commit intocompiler-research:developfrom
Conversation
…r-research#23) ramntupleview was calling GetRefId() for region queries, which silently inserts any unknown chromosome name into fRefVec. Querying chrINVALID would permanently corrupt the reference table for the rest of the session. The fix adds FindRefId() - a const lookup that returns -1 without touching fRefVec, and switches ramntupleview to use it. Unknown chromosomes now get a clear error message and an early return instead of silent corruption. Also replaced printf with std::cerr to match the rest of the codebase. Regression test added to confirm fRefVec size is unchanged after querying a non-existent chromosome. Fixes compiler-research#23
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.
ramntupleview was calling GetRefId() during region queries. Since GetRefId() always inserts unknown names into fRefVec, querying a non-existent chromosome like chrINVALID would silently corrupt the reference table for the rest of the session.
This adds FindRefId() - a const lookup that returns -1 without modifying fRefVec, and switches ramntupleview to use it. Unknown chromosomes now get a clear error message and an early return. Also replaced printf with std::cerr to match the rest of the codebase.
Files changed: inc/rntuple/RAMNTupleRecord.h, src/rntuple/RAMNTupleRecord.cxx, src/ramcore/RAMNTupleView.cxx, test/ramcoretests.cxx
Fixes #23