Skip to content

Commit

Permalink
[core] Always assign correct uid output in TRefArray::GetObjectUID()
Browse files Browse the repository at this point in the history
In `TRefArray::GetObjectUID(int &uid, TObjet *obj)`, there is a code
branch for the case of an empty TRefArray and an object with a UID
assigned. Is this case a new process ID corresponding to the object is
assigned to the `TRefArray`. However, the `uid` output parameter is not
correctly assigned in this code branch, which is fixed in this commit.

The consequence of this bug is that the, since the `uid` output
parameter is not correctly assigned, that the implementation of
`TRefArray::Add*()` does not correctly work then.

Closes root-project#12329.
  • Loading branch information
guitargeek committed Apr 11, 2023
1 parent 6496635 commit a825813
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/cont/src/TRefArray.cxx
Expand Up @@ -218,6 +218,7 @@ Bool_t TRefArray::GetObjectUID(Int_t &uid, TObject *obj, const char *methodname)
} else {
if (GetAbsLast() < 0) {
// The container is empty, we can switch the ProcessID.
uid = obj->GetUniqueID();
fPID = TProcessID::GetProcessWithUID(obj);
valid = kTRUE;
if (gDebug > 3)
Expand Down

0 comments on commit a825813

Please sign in to comment.