Slicing: Fix off-by-one error earlier this version.

This commit is contained in:
Wilson Snyder 2017-10-14 14:04:15 -04:00
parent f6a745a4c2
commit 4b7ee8267b
1 changed files with 1 additions and 1 deletions

View File

@ -163,7 +163,7 @@ class SliceVisitor : public AstNVisitor {
UINFO(9, " Bi-Eq/Neq expansion "<<nodep<<endl);
if (AstUnpackArrayDType* adtypep = fromDtp->castUnpackArrayDType()) {
AstNodeBiop* logp = NULL;
for (int index = 0; index <= adtypep->rangep()->elementsConst(); ++index) {
for (int index = 0; index < adtypep->rangep()->elementsConst(); ++index) {
// EQ(a,b) -> LOGAND(EQ(ARRAYSEL(a,0), ARRAYSEL(b,0)), ...[1])
AstNodeBiop* clonep = nodep->cloneType
(new AstArraySel(nodep->fileline(),