Fix variables declared in fork after taskify (#6126)

This commit is contained in:
Kamil Rakoczy
2025-06-26 10:28:58 -04:00
committed by GitHub
parent 818e6d3ebf
commit d183b4edde
2 changed files with 12 additions and 0 deletions
+4
View File
@@ -605,6 +605,10 @@ class ForkVisitor final : public VNVisitor {
m_modp->addStmtsp(taskp);
UINFO(9, "new " << taskp);
// We created a task from fork, so make sure that all
// local (to this new task) variables are marked as funcLocal
for (AstVar* const localp : m_forkLocalsp) localp->funcLocal(true);
AstTaskRef* const taskrefp = new AstTaskRef{nodep->fileline(), taskp, m_capturedVarRefsp};
AstStmtExpr* const taskcallp = taskrefp->makeStmt();
// Replaced nodes will be revisited, so we don't need to "lift" the arguments