mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 08:55:11 +01:00
Fix associative op const-value calculation
This commit is contained in:
1 parent
8d29cb15ce
commit
fb9a0964a2
4 files changed
+84
-9
No files matched your search
@@ -495,7 +495,7 @@ func (q *checker) bcheckAssignment(lhs *a.Expr, op t.ID, rhs *a.Expr) error {
|
||||
|
||||
func (q *checker) bcheckAssignment1(lhs *a.Expr, lTyp *a.TypeExpr, op t.ID, rhs *a.Expr) (bounds, error) {
|
||||
if lhs == nil && op != t.IDEq {
|
||||
return bounds{}, fmt.Errorf("check: internal error: missing LHS for op key 0x%02X", op)
|
||||
return bounds{}, fmt.Errorf("check: internal error: missing LHS for op key 0x%X", op)
|
||||
}
|
||||
|
||||
lb, err := bounds{}, (error)(nil)
|
||||
@@ -795,6 +795,9 @@ func bcheckExprConstValue(n *a.Expr) bounds {
|
||||
if o := n.RHS(); o != nil && n.Operator() != t.IDXBinaryAs {
|
||||
bcheckExprConstValue(o.AsExpr())
|
||||
}
|
||||
for _, o := range n.Args() {
|
||||
bcheckExprConstValue(o.AsExpr())
|
||||
}
|
||||
cv := n.ConstValue()
|
||||
b := bounds{cv, cv}
|
||||
n.SetMBounds(b)
|
||||
|
||||
Reference in new issue
Block a user