Source file
test/fixedbugs/issue16331.go
1
2
3
4
5
6
7
8
9 package main
10
11 import "reflect"
12
13 type T struct{}
14
15 func (T) M() {
16 }
17
18 func F(args []reflect.Value) (results []reflect.Value) {
19 return nil
20 }
21
22 func main() {
23 done := make(chan bool)
24 go func() {
25
26 t := reflect.TypeOf((func())(nil))
27 f := reflect.MakeFunc(t, F).Interface().(func())
28 defer f()
29 growstack(10000)
30 done <- true
31 }()
32 <-done
33 go func() {
34
35 f := reflect.ValueOf(T{}).Method(0).Interface().(func())
36 defer f()
37 growstack(10000)
38 done <- true
39 }()
40 <-done
41 }
42
43 func growstack(x int) {
44 if x == 0 {
45 return
46 }
47 growstack(x - 1)
48 }
49
View as plain text