From b6b745ffa3dffeb5ccd7fa7ad7f3d5a23fff049d Mon Sep 17 00:00:00 2001 From: Edmund Lam Date: Mon, 6 Jul 2026 11:11:19 -0400 Subject: [PATCH] Move curDTypeP test to loop --- src/V3Param.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/V3Param.cpp b/src/V3Param.cpp index 1383ef665..68fe481bd 100644 --- a/src/V3Param.cpp +++ b/src/V3Param.cpp @@ -1324,6 +1324,7 @@ class ParamProcessor final { AstMemberDType* const foundMemp = VN_CAST( m_memberMap.findMember(structp, fieldRefp->name()), MemberDType); if (!foundMemp) break; + if (!foundMemp->subDTypep()) break; totalLsb += foundMemp->lsb(); sliceWidth = foundMemp->width(); curDTypep = foundMemp->subDTypep(); @@ -1339,11 +1340,8 @@ class ParamProcessor final { = new AstSel{topp->fileline(), clonep, totalLsb, sliceWidth}; // Match V3Width::memberSelStruct: skip RefDTypes to surface // enum dtype, and mark didWidth so V3Width doesn't reflatten. - // Only mark didWidth when we have a resolved dtype to attach. - if (curDTypep) { - selp->dtypep(curDTypep->skipRefToEnump()); - selp->didWidth(true); - } + selp->dtypep(curDTypep->skipRefToEnump()); + selp->didWidth(true); topp->replaceWith(selp); VL_DO_DANGLING(topp->deleteTree(), topp); }