Source file
test/fixedbugs/issue27278.go
1
2
3
4
5
6
7
8
9
10 package main
11
12 type T struct {
13 _ [3]string
14 T2
15 }
16
17 func (t *T) M() []string {
18 return t.T2.M()
19 }
20
21 type T2 struct {
22 T3
23 }
24
25 func (t *T2) M() []string {
26 return t.T3.M()
27 }
28
29 type T3 struct {
30 a string
31 }
32
33 func (t *T3) M() []string {
34 return []string{}
35 }
36
37 func main() {
38 poison()
39 f()
40 }
41
42
43 func f() {
44 (&T{}).M()
45 grow(10000)
46 }
47
48
49 func grow(n int) {
50 if n == 0 {
51 return
52 }
53 grow(n-1)
54 }
55
56
57
58 func poison() {
59 x := [10]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
60 g = x
61 }
62
63 var g [10]int
64
View as plain text