diff options
Diffstat (limited to 'src/runtime/extern.go')
| -rw-r--r-- | src/runtime/extern.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/extern.go b/src/runtime/extern.go index ddcb81fdc7..896bfc4fcb 100644 --- a/src/runtime/extern.go +++ b/src/runtime/extern.go @@ -174,7 +174,7 @@ func Caller(skip int) (pc uintptr, file string, line int, ok bool) { return } f := findfunc(rpc[1]) - if f == nil { + if !f.valid() { // TODO(rsc): Probably a bug? // The C version said "have retpc at least" // but actually returned pc=0. @@ -187,7 +187,7 @@ func Caller(skip int) (pc uintptr, file string, line int, ok bool) { // All architectures turn faults into apparent calls to sigpanic. // If we see a call to sigpanic, we do not back up the PC to find // the line number of the call instruction, because there is no call. - if xpc > f.entry && (g == nil || g.entry != funcPC(sigpanic)) { + if xpc > f.entry && (!g.valid() || g.entry != funcPC(sigpanic)) { xpc-- } file, line32 := funcline(f, xpc) |
