1
0
mirror of https://github.com/golang/go synced 2024-11-23 10:40:08 -07:00
go/test/fixedbugs/issue6055.go
Keith Randall a97a91de06 runtime: Record jmpdefer's argument size.
Fixes bug 6055.

R=golang-dev, bradfitz, dvyukov, khr
CC=golang-dev
https://golang.org/cl/12536045
2013-08-07 14:03:50 -07:00

30 lines
448 B
Go

// run
// Copyright 2013 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.
package main
type Closer interface {
Close()
}
func nilInterfaceDeferCall() {
var x Closer
defer x.Close()
}
func shouldPanic(f func()) {
defer func() {
if recover() == nil {
panic("did not panic")
}
}()
f()
}
func main() {
shouldPanic(nilInterfaceDeferCall)
}