Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions io/io/src/TBufferFile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2593,7 +2593,8 @@ void *TBufferFile::ReadObjectAny(const TClass *clCast)
InitMap();

// before reading object save start position
UInt_t startpos = UInt_t(fBufCur-fBuffer);
ULong64_t startpos = static_cast<ULong64_t>(fBufCur-fBuffer);
ULong64_t cntpos = startpos <= kMaxCountPosition ? startpos : kOverflowPosition;
Comment on lines +2596 to +2597
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to push the startpos on the stack if it's large?


// attempt to load next object as TClass clCast
UInt_t tag; // either tag or byte count
Expand All @@ -2613,7 +2614,7 @@ void *TBufferFile::ReadObjectAny(const TClass *clCast)
Error("ReadObject", "got object of wrong class! requested %s but got %s",
clCast->GetName(), clRef->GetName());

CheckByteCount(startpos, tag, (TClass *)nullptr); // avoid mis-leading byte count error message
CheckByteCount(cntpos, tag, (TClass *)nullptr); // avoid mis-leading byte count error message
return 0; // We better return at this point
}
baseOffset = 0; // For now we do not support requesting from a class that is the base of one of the class for which there is transformation to ....
Expand All @@ -2628,7 +2629,7 @@ void *TBufferFile::ReadObjectAny(const TClass *clCast)
//we cannot mix a compiled class with an emulated class in the inheritance
Error("ReadObject", "trying to read an emulated class (%s) to store in a compiled pointer (%s)",
clRef->GetName(),clCast->GetName());
CheckByteCount(startpos, tag, (TClass *)nullptr); // avoid mis-leading byte count error message
CheckByteCount(cntpos, tag, (TClass *)nullptr); // avoid mis-leading byte count error message
return 0;
}
}
Expand All @@ -2640,7 +2641,7 @@ void *TBufferFile::ReadObjectAny(const TClass *clCast)
obj = (char *) (Longptr_t)fMap->GetValue(startpos+kMapOffset);
if (obj == (void*) -1) obj = nullptr;
if (obj) {
CheckByteCount(startpos, tag, (TClass *)nullptr);
CheckByteCount(cntpos, tag, (TClass *)nullptr);
return (obj + baseOffset);
}
}
Expand All @@ -2652,7 +2653,7 @@ void *TBufferFile::ReadObjectAny(const TClass *clCast)
MapObject((TObject*) -1, startpos+kMapOffset);
else
MapObject((void*)nullptr, nullptr, fMapCount);
CheckByteCount(startpos, tag, (TClass *)nullptr);
CheckByteCount(cntpos, tag, (TClass *)nullptr);
return 0;
}

Expand Down Expand Up @@ -2711,7 +2712,7 @@ void *TBufferFile::ReadObjectAny(const TClass *clCast)
// let the object read itself
clRef->Streamer( obj, *this, clOnfile );

CheckByteCount(startpos, tag, clRef);
CheckByteCount(cntpos, tag, clRef);
}

return obj+baseOffset;
Expand Down
Loading