Fix extraneous WIDTH warning on assoc.exists()
This commit is contained in:
parent
b26658fd96
commit
27eb8cfe8a
|
@ -3498,7 +3498,7 @@ class WidthVisitor final : public VNVisitor {
|
|||
AstNodeExpr* const index_exprp = methodCallWildcardIndexExpr(nodep, adtypep);
|
||||
newp = new AstCMethodHard{nodep->fileline(), nodep->fromp()->unlinkFrBack(), "exists",
|
||||
index_exprp->unlinkFrBack()};
|
||||
newp->dtypeSetSigned32();
|
||||
newp->dtypeSetLogicUnsized(32, 1, VSigning::SIGNED);
|
||||
} else if (nodep->name() == "delete") { // function void delete([input integer index])
|
||||
methodOkArguments(nodep, 0, 1);
|
||||
methodCallLValueRecurse(nodep, nodep->fromp(), VAccess::WRITE);
|
||||
|
@ -3590,7 +3590,7 @@ class WidthVisitor final : public VNVisitor {
|
|||
AstNodeExpr* const index_exprp = methodCallAssocIndexExpr(nodep, adtypep);
|
||||
newp = new AstCMethodHard{nodep->fileline(), nodep->fromp()->unlinkFrBack(), "exists",
|
||||
index_exprp->unlinkFrBack()};
|
||||
newp->dtypeSetSigned32();
|
||||
newp->dtypeSetLogicUnsized(32, 1, VSigning::SIGNED);
|
||||
} else if (nodep->name() == "delete") { // function void delete([input integer index])
|
||||
methodOkArguments(nodep, 0, 1);
|
||||
methodCallLValueRecurse(nodep, nodep->fromp(), VAccess::WRITE);
|
||||
|
|
|
@ -37,7 +37,9 @@ module t (/*AUTOARG*/
|
|||
v = a[4'd3]; `checks(v, "fooed");
|
||||
v = a[4'd2]; `checks(v, "bared");
|
||||
i = a.exists(4'd0); `checkh(i, 0);
|
||||
if (a.exists(4'd0)) $stop; // Check no width warning
|
||||
i = a.exists(4'd2); `checkh(i, 1);
|
||||
if (!a.exists(4'd2)) $stop; // Check no width warning
|
||||
i = a.first(k); `checkh(i, 1); `checks(k, 4'd2);
|
||||
i = a.next(k); `checkh(i, 1); `checks(k, 4'd3);
|
||||
i = a.next(k); `checkh(i, 0);
|
||||
|
|
Loading…
Reference in New Issue