Fix 'case (_) inside' with x wildcards (#7766)

Found by inspection, case inside used to threat 'x' as a value, not as a
wildcard. Per the standard it should behave as '==?' which treats both
'x' and 'z' as wildcards.
This commit is contained in:
Geza Lore
2026-06-12 07:48:36 +01:00
committed by GitHub
parent 4555c8b23c
commit 60f729639b
3 changed files with 55 additions and 2 deletions
+2 -2
View File
@@ -576,8 +576,8 @@ class CaseVisitor final : public VNVisitor {
bool neverItem(const AstCase* casep, const AstConst* itemp) {
// Xs in case or casez are impossible due to two state simulations
if (casep->casex()) {
} else if (casep->casez() || casep->caseInside()) {
if (casep->casex() || casep->caseInside()) {
} else if (casep->casez()) {
if (itemp->num().isAnyX()) return true;
} else {
if (itemp->num().isFourState()) return true;