diff --git a/src/lib/ranges/yrange.cc b/src/lib/ranges/yrange.cc index ed0e40f..1998f1a 100644 --- a/src/lib/ranges/yrange.cc +++ b/src/lib/ranges/yrange.cc @@ -64,10 +64,16 @@ namespace CNORXZ { mLex = 0; IB::mPos = 0; + bool outOfScope = false; for(SizeT i = 0; i != dim(); ++i){ + outOfScope |= mIs[i]->lex() >= mIs[i]->lmax().val(); mLex += mIs[i]->lex() * mLexFormat[i].val(); IB::mPos += mIs[i]->pos() * mFormat[i].val(); } + if(outOfScope){ + IB::mPos = pmax().val(); + mLex = lmax().val(); + } } inline void YIndex::up(SizeT i)