]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: honor GOTRACEBACK=crash even if _g_.m.traceback != 0
authorAustin Clements <austin@google.com>
Tue, 7 Mar 2017 20:24:02 +0000 (15:24 -0500)
committerAustin Clements <austin@google.com>
Tue, 7 Mar 2017 20:46:52 +0000 (20:46 +0000)
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>
src/runtime/runtime1.go

index 3d4578844bb76006096c663ac1828c699126c144..2f7317b501a4d20c98c6d0207cb2241cf652e85e 100644 (file)
@@ -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
 }