mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 16:47:28 +01:00
cgen: apply disableWconversion even more often
This commit is contained in:
1 parent
9520d6de36
commit
c4d2fa13da
2 files changed
+21
-9
No files matched your search
@@ -165,20 +165,25 @@ func (g *gen) writeStatementAssign1(b *buffer, op t.ID, lhs *a.Expr, rhs *a.Expr
|
||||
b.printf("wuffs_private_impl__u%d__sat_%s_indirect(&", uBits, uOp)
|
||||
opName, closer = ", ", ")"
|
||||
|
||||
case t.IDPlusEq, t.IDMinusEq, t.IDStarEq, t.IDShiftLEq,
|
||||
t.IDTildeModPlusEq, t.IDTildeModMinusEq, t.IDTildeModStarEq, t.IDTildeModShiftLEq:
|
||||
if lTyp.IsNumType() {
|
||||
if u := lTyp.QID()[1]; u == t.IDU8 || u == t.IDU16 {
|
||||
disableWconversion = true
|
||||
}
|
||||
}
|
||||
fallthrough
|
||||
|
||||
default:
|
||||
opName = cOpName(op)
|
||||
if opName == "" {
|
||||
return fmt.Errorf("unrecognized operator %q", op.AmbiguousForm().Str(g.tm))
|
||||
}
|
||||
|
||||
if op.IsAssign() {
|
||||
switch op {
|
||||
case t.IDAmpEq, t.IDPipeEq, t.IDHatEq, t.IDEq, t.IDEqQuestion:
|
||||
// No-op.
|
||||
|
||||
default:
|
||||
if lTyp.IsNumType() {
|
||||
if u := lTyp.QID()[1]; u == t.IDU8 || u == t.IDU16 {
|
||||
disableWconversion = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user