mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 00:55:11 +01:00
cgen: omit "x ~mod+= y ~mod* 0"
This commit is contained in:
1 parent
1f3df26c7f
commit
40f39a3ba3
5 files changed
+22
-235
No files matched your search
@@ -1777,7 +1777,13 @@ func (q *checker) bcheckExprBinaryOp1(op t.ID, lhs *a.Expr, lb bounds, rhs *a.Ex
|
||||
}, nil
|
||||
}
|
||||
|
||||
case t.IDXBinaryTildeModPlus, t.IDXBinaryTildeModMinus, t.IDXBinaryTildeModStar:
|
||||
case t.IDXBinaryTildeModStar:
|
||||
if (lb.IsJustZero() || rb.IsJustZero()) && lhs.Effect().Pure() && rhs.Effect().Pure() {
|
||||
return bounds{zero, zero}, nil
|
||||
}
|
||||
fallthrough
|
||||
|
||||
case t.IDXBinaryTildeModPlus, t.IDXBinaryTildeModMinus:
|
||||
typ := lhs.MType()
|
||||
if typ.IsIdeal() {
|
||||
typ = rhs.MType()
|
||||
|
||||
Reference in new issue
Block a user