From 2ecb90620ffed20471821cda13a7f5dddd25285b Mon Sep 17 00:00:00 2001 From: Krzysztof Boronski Date: Fri, 27 Oct 2023 17:21:14 +0200 Subject: [PATCH] Reset m_id when visitng new modules, use const Signed-off-by: Krzysztof Boronski --- src/V3Fork.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/V3Fork.cpp b/src/V3Fork.cpp index 015b6e836c..59fb91ebc8 100644 --- a/src/V3Fork.cpp +++ b/src/V3Fork.cpp @@ -68,7 +68,7 @@ class ForkDynScopeFrame final { AstNode* const m_procp; // Procedure/block associated with that dynscope std::set m_captures; // Variables to be moved into the dynscope ForkDynScopeInstance m_instance; // Nodes to be injected into the AST to create the dynscope - size_t m_id; // Dynscope ID + const size_t m_id; // Dynscope ID public: ForkDynScopeFrame(AstNodeModule* modp, AstNode* procp, size_t id) @@ -339,6 +339,7 @@ class DynScopeVisitor final : public VNVisitor { void visit(AstNodeModule* nodep) override { VL_RESTORER(m_modp); if (!VN_IS(nodep, Class)) m_modp = nodep; + m_id = 0; iterateChildren(nodep); } void visit(AstNodeFTask* nodep) override { @@ -619,6 +620,7 @@ class ForkVisitor final : public VNVisitor { void visit(AstNodeModule* nodep) override { VL_RESTORER(m_modp); m_modp = nodep; + m_id = 0; iterateChildren(nodep); } void visit(AstNode* nodep) override {