Fix nested class split crash (#7826)

Signed-off-by: Igor Zaworski <[email protected]>
This commit is contained in:
Igor Zaworski
2026-06-23 14:07:15 -04:00
committed by GitHub
parent d5c040d8e6
commit 0cd13f80c9
3 changed files with 65 additions and 1 deletions
+7 -1
View File
@@ -477,7 +477,13 @@ class SplitUnpackedVarVisitor final : public VNVisitor, public SplitVarImpl {
UINFO(4, "Start checking " << nodep->prettyNameQ());
if (!VN_IS(nodep, Module)) {
UINFO(4, "Skip " << nodep->prettyNameQ());
nodep->foreach([this](AstVarXRef* const nodep) { handleVarXRef(nodep); });
nodep->foreach([this](AstNodeVarRef* const nodep) {
if (AstVarXRef* const varXRefp = VN_CAST(nodep, VarXRef)) {
handleVarXRef(varXRefp);
} else if (m_modp) {
iterate(VN_AS(nodep, VarRef));
}
});
return;
}
UASSERT_OBJ(!m_modp, m_modp, "Nested module declaration");