Skip to content

Commit

Permalink
Reset m_id when visitng new modules, use const
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Boronski <[email protected]>
  • Loading branch information
kboronski-ant committed Oct 27, 2023
1 parent a27f5ba commit 2ecb906
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/V3Fork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ForkDynScopeFrame final {
AstNode* const m_procp; // Procedure/block associated with that dynscope
std::set<AstVar*> 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)
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2ecb906

Please sign in to comment.