I expect this program should panic, but it doesn't:
package main
func f(p, q *struct{}) bool {
return *p == *q
}
func main() {
f(nil, nil)
}
For comparison:
-
Changing f to func f(p, q *struct{ f struct{} }) bool { return p.f == q.f } causes a panic. It appears "checknotnil" checks for both of these were added to walkexpr in d3c758d, but then the OIND case was removed as "redundant" in aa0439b.
-
gccgo doesn't panic on either of these.
/cc @griesemer @ianlancetaylor
I expect this program should panic, but it doesn't:
For comparison:
Changing f to
func f(p, q *struct{ f struct{} }) bool { return p.f == q.f }causes a panic. It appears "checknotnil" checks for both of these were added to walkexpr in d3c758d, but then the OIND case was removed as "redundant" in aa0439b.gccgo doesn't panic on either of these.
/cc @griesemer @ianlancetaylor