Skip to content
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

TBranchElement: no drilling through new members. #9927

Merged
merged 3 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/meta/src/TIsAProxy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace {

TIsAProxy::TIsAProxy(const std::type_info& typ)
: fType(&typ), fClass(nullptr),
fSubTypesReaders(0), fSubTypesWriteLockTaken(kFALSE),
fSubTypesReaders(0), fSubTypesWriteLockTaken(kFALSE), fNextLastSlot(0),
fInit(kFALSE), fVirtual(kFALSE)
{
static_assert(sizeof(ClassMap_t)<=sizeof(fSubTypes), "ClassMap size is to large for array");
Expand Down
12 changes: 10 additions & 2 deletions tree/tree/src/TBranchElement.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2068,18 +2068,26 @@ static void GatherArtificialElements(const TObjArray &branches, TStreamerInfoAct
subprefix = ename + ".";
}
auto nbranches = search->GetEntriesFast();
bool foundRelatedSplit = false;
for (Int_t bi = 0; bi < nbranches; ++bi) {
TBranchElement* subbe = (TBranchElement*)search->At(bi);
bool matchSubPrefix = strncmp(subbe->GetFullName(), subprefix.Data(), subprefix.Length()) == 0;
if (!foundRelatedSplit)
foundRelatedSplit = matchSubPrefix;
if (elementClass == subbe->GetInfo()->GetClass() // Use GetInfo to provoke its creation.
&& subbe->GetOnfileObject()
&& strncmp(subbe->GetFullName(), subprefix.Data(), subprefix.Length()) == 0)
&& matchSubPrefix)
{
nextinfo = subbe->GetInfo();
onfileObject = subbe->GetOnfileObject();
break;
}
}

if (!foundRelatedSplit) {
continue;
}

if (!nextinfo) {
nextinfo = (TStreamerInfo *)elementClass->GetStreamerInfo();
if (elementClass->GetCollectionProxy() && elementClass->GetCollectionProxy()->GetValueClass()) {
Expand Down Expand Up @@ -2236,7 +2244,7 @@ void TBranchElement::InitInfo()
Bool_t seenExisting = kFALSE;

fOnfileObject = new TVirtualArray( info->GetElement(0)->GetClassPointer(), arrlen );
// Propagate this to all the other branch belonging to the same object.
// Propagate this to all the other branches belonging to the same object.
TObjArray *branches = toplevel ? GetListOfBranches() : GetMother()->GetSubBranch(this)->GetListOfBranches();
Int_t nbranches = branches->GetEntriesFast();
TBranchElement *lastbranch = this;
Expand Down