Fix conditional expressions in constraints (#7087)

This commit is contained in:
Ryszard Rozak
2026-02-17 11:40:15 -05:00
committed by GitHub
parent 81d1d79585
commit 5d0352ab46
3 changed files with 70 additions and 0 deletions
+4
View File
@@ -1423,6 +1423,10 @@ class ConstraintExprVisitor final : public VNVisitor {
// Do not burden the solver if cond computable: (cond ? "then" : "else")
iterate(nodep->thenp());
iterate(nodep->elsep());
UASSERT_OBJ(
nodep->thenp()->isString() && nodep->elsep()->isString(), nodep,
"Branches of conditional expression in constraint not converted to strings");
nodep->dtypeSetString();
return;
}
// Fall back to "(ite cond then else)"