Terminator terminator{sourceFile, sourceLine};
SubscriptValue byteStride{/*captured from first dimension*/};
std::size_t boundElementBytes{bounds.ElementBytes()};
+ pointer.raw().rank = bounds.rank();
for (int j{0}; j < bounds.rank(); ++j) {
auto &dim{pointer.GetDimension(j)};
dim.SetBounds(GetInt64(bounds.ZeroBasedIndexedElement<const char>(2 * j),
GetInt64(bounds.ZeroBasedIndexedElement<const char>(2 * j + 1),
boundElementBytes, terminator));
if (j == 0) {
- byteStride = dim.ByteStride();
+ byteStride = dim.ByteStride() * dim.Extent();
} else {
dim.SetByteStride(byteStride);
byteStride *= dim.Extent();