From 4b7ee8267b80d8d1d8dda396958bd87abf7e4353 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 14 Oct 2017 14:04:15 -0400 Subject: [PATCH] Slicing: Fix off-by-one error earlier this version. --- src/V3Slice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/V3Slice.cpp b/src/V3Slice.cpp index 6ac7b5496..25f4a3ab0 100644 --- a/src/V3Slice.cpp +++ b/src/V3Slice.cpp @@ -163,7 +163,7 @@ class SliceVisitor : public AstNVisitor { UINFO(9, " Bi-Eq/Neq expansion "<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(),