Source file
test/fixedbugs/issue43835.go
1
2
3
4
5
6
7 package main
8
9 func main() {
10 if f() {
11 panic("FAIL")
12 }
13 if bad, _ := g(); bad {
14 panic("FAIL")
15 }
16 if bad, _ := h(); bad {
17 panic("FAIL")
18 }
19 }
20
21 func f() (bad bool) {
22 defer func() {
23 recover()
24 }()
25 var p *int
26 bad, _ = true, *p
27 return
28 }
29
30 func g() (bool, int) {
31 defer func() {
32 recover()
33 }()
34 var p *int
35 return true, *p
36 }
37
38
39 func h() (_ bool, _ int) {
40 defer func() {
41 recover()
42 }()
43 var p *int
44 return true, *p
45 }
46
View as plain text