aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime1.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2017-03-07 15:24:02 -0500
committerAustin Clements <austin@google.com>2017-03-07 20:46:52 +0000
commitcaa7dacfd27beb493c262b18a9aae514863ddec7 (patch)
tree1c1f57e1aa5fe0331f6f924c345f0abdd7446a77 /src/runtime/runtime1.go
parentc310c688ffa46e2f91e40284c16d71f3921feed9 (diff)
downloadgo-caa7dacfd27beb493c262b18a9aae514863ddec7.tar.gz
go-caa7dacfd27beb493c262b18a9aae514863ddec7.zip
runtime: honor GOTRACEBACK=crash even if _g_.m.traceback != 0
Change-Id: I6de1ef8f67bde044b8706c01e98400e266e1f8f0 Reviewed-on: https://go-review.googlesource.com/37857 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/runtime1.go')
-rw-r--r--src/runtime/runtime1.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go
index 3d4578844b..2f7317b501 100644
--- a/src/runtime/runtime1.go
+++ b/src/runtime/runtime1.go
@@ -35,15 +35,14 @@ var traceback_env uint32
//go:nosplit
func gotraceback() (level int32, all, crash bool) {
_g_ := getg()
- all = _g_.m.throwing > 0
+ t := atomic.Load(&traceback_cache)
+ crash = t&tracebackCrash != 0
+ all = _g_.m.throwing > 0 || t&tracebackAll != 0
if _g_.m.traceback != 0 {
level = int32(_g_.m.traceback)
- return
+ } else {
+ level = int32(t >> tracebackShift)
}
- t := atomic.Load(&traceback_cache)
- crash = t&tracebackCrash != 0
- all = all || t&tracebackAll != 0
- level = int32(t >> tracebackShift)
return
}