Skip to content

Commit 87039a4

Browse files
committed
Fix an indexing bug caught by gcc-10
1 parent 7f0d6ab commit 87039a4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Array.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,9 @@ class Array : public ArrayView< T,
233233
int curDim = 0;
234234
typeManipulation::forEachArg( [&]( auto const newDim )
235235
{
236-
this->m_dims[ curDim++ ] = LvArray::integerConversion< INDEX_TYPE >( newDim );
236+
this->m_dims[ curDim ] = LvArray::integerConversion< INDEX_TYPE >( newDim );
237237
LVARRAY_ERROR_IF_LT( this->m_dims[ curDim ], 0 );
238+
++curDim;
238239
}, newDims ... );
239240

240241
CalculateStrides();
@@ -262,8 +263,9 @@ class Array : public ArrayView< T,
262263
int i = 0;
263264
typeManipulation::forEachArg( [&]( auto const newDim )
264265
{
265-
this->m_dims[ i++ ] = LvArray::integerConversion< INDEX_TYPE >( newDim );
266+
this->m_dims[ i ] = LvArray::integerConversion< INDEX_TYPE >( newDim );
266267
LVARRAY_ERROR_IF_LT( this->m_dims[ i ], 0 );
268+
++i;
267269
}, newDims ... );
268270

269271
CalculateStrides();

0 commit comments

Comments
 (0)