Commit caa7dacf authored by Austin Clements's avatar Austin Clements

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: 's avatarKeith Randall <khr@golang.org>
parent c310c688
......@@ -35,15 +35,14 @@ var traceback_env uint32
//go:nosplit
func gotraceback() (level int32, all, crash bool) {
_g_ := getg()
all = _g_.m.throwing > 0
if _g_.m.traceback != 0 {
level = int32(_g_.m.traceback)
return
}
t := atomic.Load(&traceback_cache)
crash = t&tracebackCrash != 0
all = all || t&tracebackAll != 0
all = _g_.m.throwing > 0 || t&tracebackAll != 0
if _g_.m.traceback != 0 {
level = int32(_g_.m.traceback)
} else {
level = int32(t >> tracebackShift)
}
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment