Delay deletes in V3Fork (#5862 attempt)

This commit is contained in:
Wilson Snyder 2025-03-22 08:03:25 -04:00
parent 48effad448
commit f9109eb61f
1 changed files with 2 additions and 2 deletions

View File

@ -330,7 +330,7 @@ class DynScopeVisitor final : public VNVisitor {
membersel->varp(refp->varp());
}
handle.relink(membersel);
VL_DO_DANGLING(refp->deleteTree(), refp);
VL_DO_DANGLING(pushDeletep(refp), refp);
}
static bool hasAsyncFork(AstNode* nodep) {
@ -591,7 +591,7 @@ class ForkVisitor final : public VNVisitor {
taskp
= makeTask(beginp->fileline(), beginp->stmtsp()->unlinkFrBackWithNext(), taskName);
beginp->unlinkFrBack(&handle);
VL_DO_DANGLING(beginp->deleteTree(), beginp);
VL_DO_DANGLING(pushDeletep(beginp), beginp);
} else if (AstNodeStmt* const stmtp = VN_CAST(nodep, NodeStmt)) {
const string taskName = generateTaskName(stmtp, "fork_stmt");
taskp = makeTask(stmtp->fileline(), stmtp->unlinkFrBack(&handle), taskName);