From 545caba72048cc813262eb29c4c4c6f8c2ab14b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Boro=C5=84ski?= <94375110+kboronski-ant@users.noreply.github.com> Date: Fri, 2 Jun 2023 17:16:42 +0200 Subject: [PATCH] Give iterated variables in foreach loops VAUTOM lifetimes (#4265) Signed-off-by: Krzysztof Boronski --- src/V3Width.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 9ff2f067e..a61445ab5 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -4680,6 +4680,7 @@ private: FileLine* const fl = varp->fileline(); auto* const whilep = new AstWhile{ fl, condp, bodysp, new AstAssign{fl, new AstVarRef{fl, varp, VAccess::WRITE}, incp}}; + varp->lifetime(VLifetime::AUTOMATIC); AstNode* const stmtsp = varp; // New statements for under new Begin stmtsp->addNext(new AstAssign{fl, new AstVarRef{fl, varp, VAccess::WRITE}, leftp}); stmtsp->addNext(whilep);