1
0
mirror of https://github.com/golang/go synced 2024-09-24 01:20:13 -06:00
go/test/fixedbugs/issue8047b.go
Russ Cox 36207a91d3 runtime: fix defer of nil func
Fixes #8047.

LGTM=r, iant
R=golang-codereviews, r, iant
CC=dvyukov, golang-codereviews, khr
https://golang.org/cl/105140044
2014-06-12 16:34:36 -04:00

23 lines
358 B
Go

// 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)
}