mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-26 17:01:35 +01:00
check: allow p[i] if p has type "ptr array[N] T"
This commit is contained in:
1 parent
b97560b292
commit
2644620770
1 file changed
+3
-1
@@ -1026,7 +1026,9 @@ func (q *checker) bcheckExprOther(n *a.Expr, depth uint32) (bounds, error) {
|
|||||||
lengthExpr = lTyp.ArrayLength()
|
lengthExpr = lTyp.ArrayLength()
|
||||||
} else if lTyp.IsPointerType() && lTyp.Inner().IsEitherArrayType() {
|
} else if lTyp.IsPointerType() && lTyp.Inner().IsEitherArrayType() {
|
||||||
lengthExpr = lTyp.Inner().ArrayLength()
|
lengthExpr = lTyp.Inner().ArrayLength()
|
||||||
if err := q.proveRecvNotEqNullptr(lhs); err != nil {
|
if lTyp.Decorator() == t.IDPtr {
|
||||||
|
// No-op.
|
||||||
|
} else if err := q.proveRecvNotEqNullptr(lhs); err != nil {
|
||||||
return bounds{}, err
|
return bounds{}, err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user