Skip to content
Snippets Groups Projects
Commit d9d1e679 authored by Philippe Canal's avatar Philippe Canal
Browse files

Fix fOffset calculation when encountering cached elements

Update the StreamerElement search in TBranchElement::InitializeOffsets
to always try to find a StreamerElement that points to one of the member
of the actual class.   This allows for properly finding the offset
of the local object within the outer object.  The previous version
was somtimes looking at 'cached' StreamerElement; however their local
offset are (often) different that the non-cached version and the
main offset is very often different.   The previous code was then
applying this offset to both the actions for the cached StreamerElement
and for the regular StreamerElement.  For the cached element the
two actions compensated each other.  For the regular element if
the local object had an object within the main object, this was
leading to the 'reading' of the local object overwriting content
in the main object.

Now the offset is calculated for the local object in regard
to the outer object using one the StreamerElement that points to
one of the member of the actual class *and* AddToOffset is
not applied to the cached object (since they are never part
of an outer object the offset is always zero).

This fixes ROOT-5437
(cherry picked from commit 4fe9faed)
parent 41a999e6
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment