mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 00:55:11 +01:00
Bounds check "x += y".
This commit is contained in:
1 parent
90c5f4758e
commit
f713bb9a21
5 files changed
+111
-43
No files matched your search
+1
-1
@@ -340,7 +340,7 @@ func (c *typeChecker) checkExprUnaryOp(n *a.Expr, depth uint32) error {
|
||||
}
|
||||
if cv := rhs.ConstValue(); cv != nil {
|
||||
if n.ID0().Key() == t.KeyXUnaryMinus {
|
||||
cv = big.NewInt(0).Neg(cv)
|
||||
cv = neg(cv)
|
||||
}
|
||||
n.SetConstValue(cv)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user