Improve too-small cast warning to show size

This commit is contained in:
Wilson Snyder
2026-04-12 18:12:41 -04:00
parent be7d26c5be
commit fac07970e6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -2631,7 +2631,7 @@ class WidthVisitor final : public VNVisitor {
if (m_vup->prelim()) {
int width = nodep->rhsp()->toSInt();
if (width < 1) {
nodep->v3error("Size-changing cast to zero or negative size");
nodep->v3error("Size-changing cast to zero or negative size: " << width);
width = 1;
}
userIterateAndNext(nodep->lhsp(), WidthVP{SELF, PRELIM}.p());