We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f14d46 commit a4d942eCopy full SHA for a4d942e
stack.go
@@ -159,14 +159,14 @@ func (c Call) PC() uintptr {
159
}
160
161
func (c Call) frame() (*runtime.Frame) {
162
- window := append(c.pcs[:], c.pcs[1] - 1)
163
- frames := runtime.CallersFrames(window)
+ frames := runtime.CallersFrames(c.pcs[:])
164
165
- head, _ := frames.Next()
166
frame, _ := frames.Next()
167
-
168
- if head.Function == "runtime.sigpanic" {
169
- frame, _ = frames.Next()
+ next, _ := frames.Next()
+ if frame.Function == "runtime.sigpanic" {
+ frame, _ = runtime.CallersFrames([]uintptr{next.PC - 1}).Next()
+ } else {
+ frame = next
170
171
172
return &frame
0 commit comments