Wrap forked processes in begins early (#6343) (#6354)

Signed-off-by: Krzysztof Bieganski <[email protected]>
This commit is contained in:
Krzysztof Bieganski
2025-09-01 17:25:57 +02:00
committed by GitHub
parent 37c79532fe
commit f58b323736
5 changed files with 56 additions and 12 deletions
+3 -2
View File
@@ -459,10 +459,11 @@ class DynScopeVisitor final : public VNVisitor {
})) {
nodep->user2(true);
// Put it in a fork to prevent lifetime issues with the local
AstFork* const forkp = new AstFork{nodep->fileline(), "", nullptr};
AstBegin* const beginp = new AstBegin{nodep->fileline(), "", nullptr};
AstFork* const forkp = new AstFork{nodep->fileline(), "", beginp};
forkp->joinType(VJoinType::JOIN_NONE);
nodep->replaceWith(forkp);
forkp->addStmtsp(nodep);
beginp->addStmtsp(nodep);
UINFO(9, "assign new fork " << forkp);
} else {
visit(static_cast<AstNodeStmt*>(nodep));