Source file
test/fixedbugs/issue63657.go
1
2
3
4
5
6
7
8
9
10 package main
11
12 type T struct {
13 a, b int
14 }
15
16
17 func f(x *T, p *bool, n int) {
18 *p = n != 0
19 useStack(1000)
20 g(&x.b)
21 }
22
23
24 func g(p *int) {
25 }
26
27 func useStack(n int) {
28 if n == 0 {
29 return
30 }
31 useStack(n - 1)
32 }
33
34 func main() {
35 mustPanic(func() {
36 var b bool
37 f(nil, &b, 3)
38 })
39 }
40
41 func mustPanic(f func()) {
42 defer func() {
43 if recover() == nil {
44 panic("expected panic, got nil")
45 }
46 }()
47 f()
48 }
49
View as plain text