Fix internal error when task without CFunc is left in the tree (#8437)

Signed-off-by: Artur Bieniek <[email protected]>
This commit is contained in:
Artur Bieniek
2026-09-22 11:36:20 -04:00
committed by GitHub
parent 4110d13131
commit 08c9032927
4 changed files with 34 additions and 0 deletions
+12
View File
@@ -1629,6 +1629,18 @@ class TaskVisitor final : public VNVisitor {
// Includes handling AstMethodCall, AstNew
UASSERT_OBJ(nodep->taskp(), nodep, "Unlinked?");
iterateIntoFTask(nodep->taskp()); // First, do hierarchical funcs
if (m_statep->ftaskNoInline(nodep->taskp()) && !m_statep->ftaskCFuncp(nodep->taskp())) {
// An earlier error (e.g. a DPI import declared twice with conflicting
// signatures) prevented creating the function, so remove the call
UASSERT_OBJ(V3Error::errorCount(), nodep, "No non-inline task, but no error issued");
if (VN_IS(nodep->backp(), StmtExpr)) {
VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep);
} else {
nodep->replaceWith(new AstConst{nodep->fileline(), AstConst::BitFalseErroring{}});
VL_DO_DANGLING(pushDeletep(nodep), nodep);
}
return;
}
UINFO(4, " FTask REF " << nodep);
UINFOTREE(9, nodep, "", "inlfunc");
UASSERT_OBJ(m_scopep, nodep, "func ref not under scope");