gc: fix infinite recursion for embedded interfaces
Fixes #1909
R=rsc, gri
CC=golang-dev
https://golang.org/cl/5523047
diff --git a/test/fixedbugs/bug395.go b/test/fixedbugs/bug395.go
new file mode 100644
index 0000000..d0af3f9
--- /dev/null
+++ b/test/fixedbugs/bug395.go
@@ -0,0 +1,15 @@
+// $G $D/$F.go || echo "Bug395"
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1909
+// Would OOM due to exponential recursion on Foo's expanded methodset in nodefmt
+package test
+
+type Foo interface {
+ Bar() interface{Foo}
+ Baz() interface{Foo}
+ Bug() interface{Foo}
+}