Fix internal error when handling typedefs containing parameterized class type members (#7635) (#7661)

Fixes #7635.
This commit is contained in:
em2machine
2026-05-27 12:17:49 -07:00
committed by GitHub
parent a2fae5eb4b
commit 29d2f522bf
3 changed files with 100 additions and 0 deletions
+8
View File
@@ -1300,6 +1300,14 @@ class ParamProcessor final {
// Resolve an unresolved RefDType whose classOrPackageOp targets a parameterized
// class or a typedef alias of one. Specializes the class and links the typedef.
void resolveParamClassRefDType(AstNodeDType* dtypep) {
// Recurse into struct/union members for buried RefDTypes
if (AstNodeUOrStructDType* const sup = VN_CAST(dtypep, NodeUOrStructDType)) {
for (AstMemberDType* memp = sup->membersp(); memp;
memp = VN_AS(memp->nextp(), MemberDType)) {
resolveParamClassRefDType(memp->subDTypep());
}
return;
}
AstRefDType* const refp = dtypep ? VN_CAST(dtypep, RefDType) : nullptr;
if (!refp) return;
if (refp->typedefp() || refp->refDTypep()) return;