summaryrefslogtreecommitdiff
path: root/test/fixedbugs/issue8047b.go
blob: de6acaab598de924cdeff4300909ae641a0c766c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// run

// Copyright 2014 The Go Authors.  All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Issue 8047. Defer setup during panic shouldn't crash for nil defer.

package main

func main() {
	defer func() {
		recover()
	}()
	f()
}

func f() {
	var g func()
	defer g()
	panic(1)
}