Source file
test/fixedbugs/issue24488.go
1
2
3
4
5
6
7 package main
8
9 import (
10 "runtime"
11 "strings"
12 )
13
14 type Func func()
15
16 func (f Func) Foo() {
17 if f != nil {
18 f()
19 }
20 }
21
22 func (f Func) Bar() {
23 if f != nil {
24 f()
25 }
26 buf := make([]byte, 4000)
27 n := runtime.Stack(buf, true)
28 s := string(buf[:n])
29 if strings.Contains(s, "-fm") {
30 panic("wrapper present in stack trace:\n" + s)
31 }
32 }
33
34 func main() {
35 foo := Func(func() {})
36 foo = foo.Bar
37 foo.Foo()
38 }
39
View as plain text