Fix no-scope internal error on virtual interface method calls (#7759)

This commit is contained in:
Yilou Wang
2026-06-11 09:04:06 -04:00
committed by GitHub
parent 394c9bc9b2
commit c6caa94fe0
3 changed files with 46 additions and 3 deletions
+4 -3
View File
@@ -248,9 +248,9 @@ private:
UASSERT_OBJ(nodep->taskp(), nodep, "Unlinked task");
TaskFTaskVertex* const taskVtxp = getFTaskVertex(nodep->taskp());
new TaskEdge{&m_callGraph, m_curVxp, taskVtxp};
if (isVirtualIfaceMethodCall(nodep) && isIfaceFTaskScope(getScope(nodep->taskp()))) {
taskVtxp->needsNonInlineCFunc(true);
}
// Virtual-interface method calls dispatch through a runtime handle and
// must not be inlined.
if (isVirtualIfaceMethodCall(nodep)) taskVtxp->needsNonInlineCFunc(true);
// Do we have to disable inlining the function?
const V3TaskConnects tconnects = V3Task::taskConnects(nodep, nodep->taskp()->stmtsp());
if (!taskVtxp->noInline()) { // Else short-circuit below
@@ -1638,6 +1638,7 @@ class TaskVisitor final : public VNVisitor {
// Create cloned statements
AstNode* beginp;
AstCNew* cnewp = nullptr;
// getScope() is safe here: TaskStateVisitor stamped all FTask scopes before this pass.
const bool virtualIfaceCall
= TaskStateVisitor::isVirtualIfaceMethodCall(nodep)
&& TaskStateVisitor::isIfaceFTaskScope(m_statep->getScope(nodep->taskp()));