gc: disallow map/func equality via interface comparison
Missed when I removed direct map/func equality.
R=ken2
CC=golang-dev
https://golang.org/cl/5452052
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c
index 8bdfaf7..5584f78 100644
--- a/src/cmd/gc/subr.c
+++ b/src/cmd/gc/subr.c
@@ -499,8 +499,7 @@
{
int a;
- if(issimple[t->etype] || isptr[t->etype] ||
- t->etype == TCHAN || t->etype == TFUNC || t->etype == TMAP) {
+ if(issimple[t->etype] || isptr[t->etype] || t->etype == TCHAN) {
if(t->width == 1)
a = AMEM8;
else if(t->width == 2)
diff --git a/src/pkg/reflect/all_test.go b/src/pkg/reflect/all_test.go
index a9e5d1c..e432601 100644
--- a/src/pkg/reflect/all_test.go
+++ b/src/pkg/reflect/all_test.go
@@ -468,8 +468,8 @@
func TestFunctionValue(t *testing.T) {
var x interface{} = func() {}
v := ValueOf(x)
- if v.Interface() != v.Interface() || v.Interface() != x {
- t.Fatalf("TestFunction != itself")
+ if fmt.Sprint(v.Interface()) != fmt.Sprint(x) {
+ t.Fatalf("TestFunction returned wrong pointer")
}
assert(t, v.Type().String(), "func()")
}