From 8b0fd1bd221402d6662bd2c6fe857901527c160a Mon Sep 17 00:00:00 2001
From: Brian Bockelman <bbockelm@cse.unl.edu>
Date: Thu, 21 Sep 2017 22:25:52 -0500
Subject: [PATCH] Disable offset-generation-skipping for correct leaves.

This fixes an issue where offset-generation-skipping was incorrectly disabled
for TLeafO (which is Bool_t, not TObects!) but enabled for TLeafElement and
TLeafObject.

It is intended that more fine-grained whitelisting of objects in TLeafElement
and TLeafObject will be done in the future.
---
 tree/tree/inc/TLeafElement.h | 2 ++
 tree/tree/inc/TLeafO.h       | 2 --
 tree/tree/inc/TLeafObject.h  | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tree/tree/inc/TLeafElement.h b/tree/tree/inc/TLeafElement.h
index 2b560a6470a..19033ba9be1 100644
--- a/tree/tree/inc/TLeafElement.h
+++ b/tree/tree/inc/TLeafElement.h
@@ -39,6 +39,8 @@ public:
    TLeafElement(TBranch *parent, const char *name, Int_t id, Int_t type);
    virtual ~TLeafElement();
 
+   virtual Bool_t   CanGenerateOffsetArray() { return false; }
+   virtual Int_t   *GenerateOffsetArrayBase(Int_t /*base*/, Int_t /*events*/) { return nullptr; }
    virtual Int_t    GetLen() const {return ((TBranchElement*)fBranch)->GetNdata()*fLen;}
    TMethodCall     *GetMethodCall(const char *name);
    virtual Int_t    GetMaximum() const {return ((TBranchElement*)fBranch)->GetMaximum();}
diff --git a/tree/tree/inc/TLeafO.h b/tree/tree/inc/TLeafO.h
index e17e43d8106..6b57d498477 100644
--- a/tree/tree/inc/TLeafO.h
+++ b/tree/tree/inc/TLeafO.h
@@ -36,10 +36,8 @@ public:
    TLeafO(TBranch *parent, const char *name, const char *type);
    virtual ~TLeafO();
 
-   virtual Bool_t CanGenerateOffsetArray() { return false; }
    virtual void    Export(TClonesArray *list, Int_t n);
    virtual void    FillBasket(TBuffer &b);
-   virtual Int_t *GenerateOffsetArrayBase(Int_t base, Int_t events) { return nullptr; }
    virtual Int_t   GetMaximum() const {return fMaximum;}
    virtual Int_t   GetMinimum() const {return fMinimum;}
    const char     *GetTypeName() const;
diff --git a/tree/tree/inc/TLeafObject.h b/tree/tree/inc/TLeafObject.h
index f1fe9af682e..f9bee292f36 100644
--- a/tree/tree/inc/TLeafObject.h
+++ b/tree/tree/inc/TLeafObject.h
@@ -53,7 +53,9 @@ public:
    TLeafObject(TBranch *parent, const char *name, const char *type);
    virtual ~TLeafObject();
 
+   virtual Bool_t  CanGenerateOffsetArray() { return false; }
    virtual void    FillBasket(TBuffer &b);
+   virtual Int_t  *GenerateOffsetArrayBase(Int_t /*base*/, Int_t /*events*/) { return nullptr; }
    TClass         *GetClass() const {return fClass;}
    TMethodCall    *GetMethodCall(const char *name);
    TObject        *GetObject() const {return (TObject*)(*fObjAddress);}
-- 
GitLab