diff options
author | Austin Clements <austin@google.com> | 2018-01-31 17:34:22 -0500 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2018-02-13 21:01:25 +0000 |
commit | 615d44c287a9c8a5f1062dd24ba341d806abc944 (patch) | |
tree | 23cb45d41b62fcd1c539ae067b33aadb05606031 /src/runtime/signal_mips64x.go | |
parent | b1679e4d03268a6792e6b8d573ac31080d9d9baf (diff) | |
download | go-git-615d44c287a9c8a5f1062dd24ba341d806abc944.tar.gz |
runtime: refactor test for pushing sigpanic frame
This logic is duplicated in all of the preparePanic functions. Pull it
out into one architecture-independent function.
Change-Id: I7ef4e78e3eda0b7be1a480fb5245fc7424fb2b4e
Reviewed-on: https://go-review.googlesource.com/91255
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/signal_mips64x.go')
-rw-r--r-- | src/runtime/signal_mips64x.go | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/runtime/signal_mips64x.go b/src/runtime/signal_mips64x.go index 35b356c2fb..1b9684295e 100644 --- a/src/runtime/signal_mips64x.go +++ b/src/runtime/signal_mips64x.go @@ -73,18 +73,8 @@ func (c *sigctxt) preparePanic(sig uint32, gp *g) { pc := gp.sigpc - // If we don't recognize the PC as code - // but we do recognize the link register as code, - // then assume this was a call to non-code and treat like - // pc == 0, to make unwinding show the context. - if pc != 0 && !findfunc(pc).valid() && findfunc(uintptr(c.link())).valid() { - pc = 0 - } - - // Don't bother saving PC if it's zero, which is - // probably a call to a nil func: the old link register - // is more useful in the stack trace. - if pc != 0 { + if shouldPushSigpanic(gp, pc, uintptr(c.link())) { + // Make it look the like faulting PC called sigpanic. c.set_link(uint64(pc)) } |