Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 6.22/00
-
Component/s: TTree
-
Labels:None
-
Environment:
any
Description
To reproducer, run with:
root -l -q -e '.L repro.cpp++' && g++ -o repro repro.cpp $(root-config --libs --cflags) && ./repro
|
the following code:
// repro.cpp
|
#include <TTree.h>
|
#include <TFile.h>
|
#include <TInterpreter.h>
|
|
struct Int { |
int x; |
};
|
|
int main() |
{
|
gInterpreter->Load("repro_cpp.so"); |
TFile f("f.root", "recreate"); |
Int i{-1};
|
int x = 1; |
TTree t("t", "t"); |
t.Branch("i", &i); |
t.Branch("x", &x); |
t.Fill();
|
t.Write();
|
f.Close();
|
|
TFile("f.root").Get<TTree>("t")->Scan(); return 0; |
}
|
prints
************************************
|
* Row * i.x * x *
|
************************************
|
* 0 * -1 * -1 *
|
************************************
|
x value should be 1, it's -1 instead.
Interestingly, inverting the order of the Branch calls fixes the issue.
A more complete reproducer for all issues I have found so far is available in the comments.