Fix wildcard equality against a 4-state constant in an assertion (#8056) (#8057)

This commit is contained in:
Nikolai Kumar
2026-08-07 07:48:51 +01:00
committed by GitHub
parent 1a4bcac666
commit 82dab79096
3 changed files with 96 additions and 0 deletions
+4
View File
@@ -4585,6 +4585,10 @@ class ConstVisitor final : public VNVisitor {
// Custom
// Implied by AstIsUnbounded::numberOperate: V("AstIsUnbounded{$lhsp.castConst}", "replaceNum(nodep, 0)");
TREEOPV("AstIsUnbounded{$lhsp.castUnbounded}", "replaceNum(nodep, 1)");
// Sampled value functions of a constant.
// $rose/$fell/$stable/$changed are lowered to $past by V3AssertPre, so they fold via AstPast
TREEOPV("AstSampled{$exprp.castConst}", "replaceWChild(nodep, VN_AS(nodep->exprp(), NodeExpr))");
TREEOPV("AstPast{$exprp.castConst, !$ticksp}", "replaceWChild(nodep, nodep->exprp())");
// clang-format on
// Possible futures: