Fix false ENUMVALUE on expressions and arrays.

This commit is contained in:
Wilson Snyder
2023-03-15 21:56:35 -04:00
parent 36da6a3563
commit 8ae79066a2
5 changed files with 56 additions and 1 deletions
+3 -1
View File
@@ -1342,7 +1342,9 @@ void AstNode::dtypeChgWidthSigned(int width, int widthMin, VSigning numeric) {
dtypeSetLogicUnsized(width, widthMin, numeric);
} else {
if (width == dtypep()->width() && widthMin == dtypep()->widthMin()
&& numeric == dtypep()->numeric())
&& numeric == dtypep()->numeric()
// Enums need to become direct sizes to avoid later ENUMVALUE errors
&& !VN_IS(dtypep()->skipRefToEnump(), EnumDType))
return; // Correct already
// FUTURE: We may be pointing at a two state data type, and this may
// convert it to logic. Since the AstVar remains correct, we