diff --git a/core/meta/src/TIsAProxy.cxx b/core/meta/src/TIsAProxy.cxx index 55b463452d929..57504c4a0372c 100644 --- a/core/meta/src/TIsAProxy.cxx +++ b/core/meta/src/TIsAProxy.cxx @@ -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"); diff --git a/tree/tree/src/TBranchElement.cxx b/tree/tree/src/TBranchElement.cxx index 04fab60c23378..76c096b154068 100644 --- a/tree/tree/src/TBranchElement.cxx +++ b/tree/tree/src/TBranchElement.cxx @@ -2068,11 +2068,15 @@ 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(); @@ -2080,6 +2084,10 @@ static void GatherArtificialElements(const TObjArray &branches, TStreamerInfoAct } } + if (!foundRelatedSplit) { + continue; + } + if (!nextinfo) { nextinfo = (TStreamerInfo *)elementClass->GetStreamerInfo(); if (elementClass->GetCollectionProxy() && elementClass->GetCollectionProxy()->GetValueClass()) { @@ -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;