Skip to content

Commit

Permalink
io json: properly scan content of pointer to array.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcanal committed Feb 6, 2025
1 parent 7e77f51 commit dde6d28
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion io/io/src/TBufferJSON.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,13 @@ TString TBufferJSON::JsonWriteMember(const void *ptr, TDataMember *member, TClas
if (indx.IsArray() && (tid == kChar_t))
shift = indx.ReduceDimension();

auto unitSize = member->GetUnitSize();
char *ppp = (char *)ptr;
if (member->IsaPointer()) {
// UnitSize was the sizeof(void*)
assert(member->GetDataType());
unitSize = member->GetDataType()->Size();
}

if (indx.IsArray())
fOutBuffer.Append(indx.GetBegin());
Expand Down Expand Up @@ -1079,7 +1085,7 @@ TString TBufferJSON::JsonWriteMember(const void *ptr, TDataMember *member, TClas
if (indx.IsArray())
fOutBuffer.Append(indx.NextSeparator());

ppp += shift * member->GetUnitSize();
ppp += shift * unitSize;

} while (!indx.IsDone());

Expand Down

0 comments on commit dde6d28

Please sign in to comment.