Fix constraint if/else regression from bare-var wrapping

This commit is contained in:
Yilou Wang 2026-03-03 11:00:56 +01:00
parent 472160683f
commit def08100d8
1 changed files with 1 additions and 0 deletions

View File

@ -1722,6 +1722,7 @@ class ConstraintExprVisitor final : public VNVisitor {
newp = new AstLogIf{fl, new AstNot{fl, nodep->condp()->unlinkFrBack()}, elsep};
}
if (newp) {
newp->dtypeSetBit(); // Result is boolean (prevents bare-var != 0 wrapping)
newp->user1(true); // Assume result-dependent
nodep->replaceWith(new AstConstraintExpr{fl, newp});
} else {