Source file
test/fixedbugs/issue32288.go
1
2
3
4
5
6
7 package main
8
9 type T struct {
10 s [1]string
11 pad [16]uintptr
12 }
13
14
15 func f(t *int, p *int) []T {
16 var res []T
17 for {
18 var e *T
19 res = append(res, *e)
20 }
21 }
22
23 func main() {
24 defer func() {
25 useStack(100)
26
27
28 recover()
29 }()
30 junk()
31 f(nil, nil)
32 }
33
34 func useStack(n int) {
35 if n == 0 {
36 return
37 }
38 useStack(n - 1)
39 }
40
41
42 func junk() uintptr {
43 var a [128]uintptr
44 for i := range a {
45 a[i] = 0xaa
46 }
47 return a[12]
48 }
49
View as plain text