Fix VL_TO_STRING function for array of structs (#7912)

Signed-off-by: Kornel Uriasz <[email protected]>
This commit is contained in:
Kornel Uriasz
2026-07-09 08:40:24 -07:00
committed by GitHub
parent a21bd8a417
commit 9740203485
2 changed files with 19 additions and 1 deletions
+7 -1
View File
@@ -6680,7 +6680,13 @@ class WidthVisitor final : public VNVisitor {
} else if (dtypep->isString()) {
formatAttr = VFormatAttr::STRING;
} else if (isFormatNonNumericArg(dtypep)) {
if (AstVarRef* const varRefp = VN_CAST(argp, VarRef)) {
const AstNodeExpr* formatTypeArgp = argp;
if (const AstCMethodHard* const cmethp = VN_CAST(formatTypeArgp, CMethodHard)) {
if (cmethp->method() == VCMethod::ARRAY_AT) formatTypeArgp = cmethp->fromp();
} else if (const AstArraySel* const arselp = VN_CAST(formatTypeArgp, ArraySel)) {
formatTypeArgp = arselp->fromp();
}
if (const AstVarRef* const varRefp = VN_CAST(formatTypeArgp, VarRef)) {
if (AstClassRefDType* const classRefp
= VN_CAST(varRefp->dtypep(), ClassRefDType)) {
if (classRefp->classp()) {