Skip to content

fix: stop invalid chromosome queries from corrupting fRefVec (#23)#53

Open
ZaGrayWolf wants to merge 1 commit intocompiler-research:developfrom
ZaGrayWolf:fix/frefvec-v2
Open

fix: stop invalid chromosome queries from corrupting fRefVec (#23)#53
ZaGrayWolf wants to merge 1 commit intocompiler-research:developfrom
ZaGrayWolf:fix/frefvec-v2

Conversation

@ZaGrayWolf
Copy link
Copy Markdown

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

…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
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.

[Bug] Querying an invalid chromosome using ramntupleview adds it to fRefVec

1 participant