mirror of
https://github.com/verilator/verilator.git
synced 2026-08-31 18:14:33 +02:00
Fix conditional expressions in constraints (#7087)
This commit is contained in:
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user