Skip to content

Commit

Permalink
Emulated Collection Proxy always need the VectorLooper for the Stream…
Browse files Browse the repository at this point in the history
…erInfoActions

This fixes root-project#9136.

Without this commit, SelectLooper would select the 'GenericLooper'
in the case of an emulated proxy for STL collection with (in the
name) a custom allocator.  However the GenericLooper only usable
for collection with a compiled collection proxy.

In particular, GenericLooper is calling the 'Next' function which
is not defined for vector ... and emulated collection.  Using
it lead to an assert complaining (right fully so) that an
'undefined' function is being called.
  • Loading branch information
pcanal committed Jan 30, 2022
1 parent 71a5f3f commit 68d37bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion io/io/src/TStreamerInfoActions.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,9 @@ namespace TStreamerInfoActions

ESelectLooper SelectLooper(TVirtualCollectionProxy &proxy)
{
if ( (proxy.GetCollectionType() == ROOT::kSTLvector) || (proxy.GetProperties() & TVirtualCollectionProxy::kIsEmulated) ) {
if ( (proxy.GetProperties() & TVirtualCollectionProxy::kIsEmulated) ) {
return kVectorLooper;
} else if ( (proxy.GetCollectionType() == ROOT::kSTLvector)) {
if (proxy.GetProperties() & TVirtualCollectionProxy::kCustomAlloc)
return kGenericLooper;
else
Expand Down Expand Up @@ -2647,6 +2649,8 @@ namespace TStreamerInfoActions
template <typename T>
static INLINE_TEMPLATE_ARGS Int_t ReadCollectionBasicType(TBuffer &buf, void *addr, const TConfiguration *conf)
{
//TODO: Check whether we can implement this without loading the data in
// a temporary variable and whether this is noticeably faster.
return ReadNumericalCollection<ConvertBasicType<T,T,Numeric > >(buf,addr,conf);
}

Expand Down

0 comments on commit 68d37bc

Please sign in to comment.