Repository navigation
[6.42] [tree] Use the counter of the same object for variable-size arrays - #24264
Merged
pcanal merged 2 commits intoNov 20, 2026
Merged
Conversation
When two objects of the same class are stored in top-level branches
whose names have no trailing dot, their sub-branches get identical
names, e.g. "fN" and "fX" under both "a" and "b". The counter of a
variable-size array member (`Double_t *fX; //[fN]`) was found with
TTree::GetBranch("fN"), which returns the first match in the tree. So
b.fX used a.fN as its counter, and that link was stored in the file.
Look up the counter among the sub-branches of the array's parent
first, and only fall back to the tree-wide search if it is not there.
This covers basic-type arrays, arrays of objects and the MakeClass
recovery path in ReadLeavesMakeClass.
Files written before this change store the wrong counter and are still
read incorrectly; this is not addressed here.
Assisted-by: claude-code:claude-opus-5-5
(cherry picked from commit d8a37e6)
For a variable-size array member of a split object, TTreeReaderArray
took only the short name of the counter branch ("fN") and looked it up
again in the tree. With two objects of the same class in top-level
branches without a trailing dot, that lookup returns the first "fN" in
the tree, so b.fX was read with a.fN's size even when the file stores
the right counter.
Pass the counter branch itself to the size reader and read the size
through the counter's full name ("b.fN").
Fixes root-project#24146
Assisted-by: claude-code:claude-opus-5-5
(cherry picked from commit 1fa357d)
root-project-bot
requested review from
bellenot,
jblomer and
pcanal
as code owners
November 19, 2026 23:01
1 of 2 tasks
Test Results 24 files 24 suites 4d 2h 36m 20s ⏱️ Results for commit e02307a. |
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.
Backport of #24183, requested by @pcanal. For your information @kr1xh