Skip to content

Commit

Permalink
Error out if the offset and size hint are the same
Browse files Browse the repository at this point in the history
  • Loading branch information
pcanal committed Nov 25, 2020
1 parent 469b539 commit 6d29b44
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions io/io/src/TStreamerInfo.cxx
Expand Up @@ -5678,6 +5678,12 @@ TVirtualStreamerInfo *TStreamerInfo::GenerateInfoForPair(const std::string &firs
// This TStreamerInfo is then used as if it was read from a file to generate
// and emulated TClass.

if (hint_pair_offset && hint_pair_offset == hint_pair_size) {
Error("GenerateInfoForPair",
"Called with inconsistent offset and size. For \"std::pair<%s,%s>\" requested offset is %d but size is the same (%d)",
firstname.c_str(), secondname.c_str(), hint_pair_offset, hint_pair_offset);
return nullptr;
}
TStreamerInfo *i = (TStreamerInfo*)TClass::GetClass("pair<const int,int>")->GetStreamerInfo()->Clone();
std::string pname = "pair<" + firstname + "," + secondname;
pname += (pname[pname.length()-1]=='>') ? " >" : ">";
Expand Down

0 comments on commit 6d29b44

Please sign in to comment.