mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:08 +00:00
runtime: Better test tracebackability of jmpdefer when running a nil defer.
R=bradfitz, dvyukov CC=golang-dev https://golang.org/cl/12536046
This commit is contained in:
parent
e3dbb1a310
commit
36f223dace
1 changed files with 6 additions and 0 deletions
|
@ -6,11 +6,17 @@
|
|||
|
||||
package main
|
||||
|
||||
import "runtime"
|
||||
|
||||
type Closer interface {
|
||||
Close()
|
||||
}
|
||||
|
||||
func nilInterfaceDeferCall() {
|
||||
defer func() {
|
||||
// make sure a traceback happens with jmpdefer on the stack
|
||||
runtime.GC()
|
||||
}()
|
||||
var x Closer
|
||||
defer x.Close()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue