From 590b34701d0b15c8bca4c96f574bd458c78ce682 Mon Sep 17 00:00:00 2001 From: Kamil Danecki Date: Thu, 19 Mar 2026 11:23:32 +0100 Subject: [PATCH] other check Signed-off-by: Kamil Danecki --- src/V3Begin.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/V3Begin.cpp b/src/V3Begin.cpp index 44b49ce3c..95d1fde7b 100644 --- a/src/V3Begin.cpp +++ b/src/V3Begin.cpp @@ -301,19 +301,21 @@ class BeginVisitor final : public VNVisitor { // If static variable, move it outside a function. if (nodep->lifetime().isStatic() && m_ftaskp) { if (nodep->user1()) { - UINFO(0, "RETURN"); + // UINFO(0, "RETURN"); return; } - UINFO(0, "TASK IS STATIC " << m_ftaskp->lifetime().isStatic()); + // UINFO(0, "TASK IS STATIC " << m_ftaskp->lifetime().isStatic()); const std::string newName = m_ftaskp->name() + "__Vstatic__" + dot(m_unnamedScope, nodep->name()); - AstVar* keepAsPort = nodep->cloneTreePure(false); - nodep->replaceWith(keepAsPort); + if (m_ftaskp->lifetime().isStatic()) { + AstVar* keepAsPort = nodep->cloneTreePure(false); + nodep->replaceWith(keepAsPort); + m_statep->userMarkChanged(keepAsPort); + } nodep->name(newName); // nodep->unlinkFrBack(); m_ftaskp->addHereThisAsNext(nodep); nodep->funcLocal(false); - m_statep->userMarkChanged(keepAsPort); // m_statep->userMarkChanged(nodep); } else if (m_unnamedScope != "") { // Rename it