diff options
Diffstat (limited to 'test/fixedbugs/issue8047b.go')
-rw-r--r-- | test/fixedbugs/issue8047b.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/fixedbugs/issue8047b.go b/test/fixedbugs/issue8047b.go new file mode 100644 index 000000000..de6acaab5 --- /dev/null +++ b/test/fixedbugs/issue8047b.go @@ -0,0 +1,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) +} |