diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-01-29 15:31:10 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-01-29 15:31:10 +0000 |
commit | 6065f1c5889159c9fa1b6c74726d04fc9abea9fe (patch) | |
tree | fc8bafc955762ebe803bb67f0b2813659c95f935 | |
parent | fac31afe6a8ee178de0662353dbd6f2cc5ab3556 (diff) | |
download | gcc-6065f1c5889159c9fa1b6c74726d04fc9abea9fe.zip gcc-6065f1c5889159c9fa1b6c74726d04fc9abea9fe.tar.gz gcc-6065f1c5889159c9fa1b6c74726d04fc9abea9fe.tar.bz2 |
runtime: fix sigprof frame counting
If sigtramp and sigtrampgo are both on stack, n -= framesToDiscard
is executed twice, which should actually run only once.
Reviewed-on: https://go-review.googlesource.com/c/159238
From-SVN: r268366
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | libgo/go/runtime/proc.go | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 0eff5eb..10e20ce 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -c2cac0ba0a92e74d5675c3c9f4e53d2567dbc903 +5af8ee0693944c280b1f529450dbfd4ec1ee451d The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/runtime/proc.go b/libgo/go/runtime/proc.go index 05dd53d..b4fa88f 100644 --- a/libgo/go/runtime/proc.go +++ b/libgo/go/runtime/proc.go @@ -3542,14 +3542,13 @@ func sigprof(pc uintptr, gp *g, mp *m) { for i := 0; i < n; i++ { if stklocs[i].function == "runtime.sigtrampgo" && i+2 < n { framesToDiscard = i + 2 - n -= framesToDiscard } if stklocs[i].function == "runtime.sigtramp" && i+2 < n { framesToDiscard = i + 2 - n -= framesToDiscard break } } + n -= framesToDiscard for i := 0; i < n; i++ { stk[i] = stklocs[i+framesToDiscard].pc } |