Do not use function locals in SenExprBuilder (#5822)

Function locals are not safe here because we might need to split up
the generated function. V3Localize can fix them later if safe.
This commit is contained in:
Geza Lore
2025-03-02 16:13:59 +00:00
committed by GitHub
parent bab949a468
commit 0133bc6b09
5 changed files with 24 additions and 51 deletions
+1 -4
View File
@@ -933,10 +933,7 @@ class TimingControlVisitor final : public VNVisitor {
UASSERT_OBJ(m_senExprBuilderp, nodep, "No SenExprBuilder for this scope");
auto* const assignp = new AstAssign{flp, new AstVarRef{flp, trigvscp, VAccess::WRITE},
m_senExprBuilderp->build(sensesp).first};
// Put all the locals and inits before the trigger eval loop
for (AstVar* const varp : m_senExprBuilderp->getAndClearLocals()) {
nodep->addHereThisAsNext(varp);
}
// Put all and inits before the trigger eval loop
for (AstNodeStmt* const stmtp : m_senExprBuilderp->getAndClearInits()) {
nodep->addHereThisAsNext(stmtp);
}