diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 7419fcac7..c9b2defaa 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -2550,7 +2550,9 @@ class WidthVisitor final : public VNVisitor { EXTEND_EXP); for (AstNode *nextip, *itemp = nodep->itemsp(); itemp; itemp = nextip) { nextip = itemp->nextp(); // iterate may cause the node to get replaced - iterateCheck(nodep, "Inside Item", itemp, CONTEXT_DET, FINAL, subDTypep, EXTEND_EXP); + // InsideRange will get replaced with Lte&Gte and finalized later + if (!VN_IS(itemp, InsideRange)) + iterateCheck(nodep, "Inside Item", itemp, CONTEXT_DET, FINAL, subDTypep, EXTEND_EXP); } if (debug() >= 9) nodep->dumpTree("- inside-in: "); diff --git a/test_regress/t/t_inside.v b/test_regress/t/t_inside.v index 4b02c90f5..a832823d5 100644 --- a/test_regress/t/t_inside.v +++ b/test_regress/t/t_inside.v @@ -57,6 +57,7 @@ module t; `checkh ((4'd3 inside {[4'd1:4'd2], [4'd3:4'd5]}), 1'b1); `checkh ((4'd4 inside {[4'd1:4'd2], [4'd3:4'd5]}), 1'b1); `checkh ((4'd5 inside {[4'd1:4'd2], [4'd3:4'd5]}), 1'b1); + `checkh ((4.0 inside {[4'd1:4'd2], [4'd3:4'd5]}), 1'b1); // // Unsupported $ bound //