// errorcheck -0 -d=nil
-// +build !wasm
-// +build !aix
+//go:build !wasm && !aix
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
return p[5] // ERROR "removed nil check"
}
-// make sure not to do nil check for access of PAUTOHEAP
-//go:noinline
-func (p *Struct) m() {}
-func c1() {
- var x Struct
- func() { x.m() }() // ERROR "removed nil check"
-}
-
type SS struct {
x byte
}
y := x[:] // ERROR "removed nil check"
return y
}
+
+// See issue 42673.
+func f10(p **int) int {
+ return * // ERROR "removed nil check"
+ /* */
+ *p // ERROR "removed nil check"
+}
+
+func f11(x []byte) {
+ p := (*[0]byte)(x)
+ _ = *p // ERROR "generated nil check"
+ q := (*[4]byte)(x)
+ _ = *q // ERROR "removed nil check"
+}