diff --git a/src/V3LinkInc.cpp b/src/V3LinkInc.cpp index 381f81ff8..cf3599958 100644 --- a/src/V3LinkInc.cpp +++ b/src/V3LinkInc.cpp @@ -124,6 +124,14 @@ private: iterateChildren(nodep); m_insStmtp = NULL; // Next thing should be new statement } + virtual void visit(AstNodeBlock* nodep) VL_OVERRIDE { + AstNode* insStmtp_prev = m_insStmtp; + { + m_insStmtp = NULL; + iterateChildren(nodep); + } + m_insStmtp = insStmtp_prev; + } void unsupported_visit(AstNode* nodep) { m_unsupportedHere = true; UINFO(9, "Marking unsupported " << nodep << endl); diff --git a/test_regress/t/t_array_index_increment.v b/test_regress/t/t_array_index_increment.v index 122227d93..b306f2122 100644 --- a/test_regress/t/t_array_index_increment.v +++ b/test_regress/t/t_array_index_increment.v @@ -107,6 +107,14 @@ module t (/*AUTOARG*/ if (i !== 4) $stop; if (val !== 4) $stop; + + pos = 0; + if (1 == 1) begin + pos++; + end + + if (pos != 1) $stop; + $write("*-* All Finished *-*\n"); $finish;