From a3a456779d25329c92795d87da3ae11e5bcd3754 Mon Sep 17 00:00:00 2001 From: Matthew Ballance Date: Thu, 5 Mar 2026 04:49:38 +0000 Subject: [PATCH] Fix V3Fork lifetime assertion by restoring V3LinkInc temp var lifetime Commit b4244fc57 accidentally dropped the varp->lifetime(VLifetime::AUTOMATIC_EXPLICIT) line when reverting V3LinkInc.cpp to a merge base. This caused __Vincrement* temp variables to have VLifetime::NONE, triggering V3Fork's assertion that all variables inside fork...join_none blocks have a known lifetime. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/V3LinkInc.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/V3LinkInc.cpp b/src/V3LinkInc.cpp index 3fbb7999a..a770b7017 100644 --- a/src/V3LinkInc.cpp +++ b/src/V3LinkInc.cpp @@ -309,6 +309,7 @@ class LinkIncVisitor final : public VNVisitor { AstVar* const varp = new AstVar{ fl, VVarType::BLOCKTEMP, name, VFlagChildDType{}, new AstRefDType{fl, AstRefDType::FlagTypeOfExpr{}, readp->cloneTree(true)}}; + varp->lifetime(VLifetime::AUTOMATIC_EXPLICIT); if (m_ftaskp) varp->funcLocal(true); // Declare the variable