]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix *bsd/amd64 build
authorMatthew Dempsky <mdempsky@google.com>
Wed, 14 Jan 2015 21:30:34 +0000 (13:30 -0800)
committerRuss Cox <rsc@golang.org>
Wed, 14 Jan 2015 23:58:36 +0000 (23:58 +0000)
6g does not implement dead code elimination for const switches like it
does for const if statements, so the undefined raiseproc() function
was resulting in a link-time failure.

Change-Id: Ie4fcb3716cb4fe6e618033071df9de545ab3e0af
Reviewed-on: https://go-review.googlesource.com/2830
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/signal_amd64x.go

index 8185e9ac126f2911b663f3b1add7bca856eb1fd0..50ecfbe4de5a7333213cc2c63a1576ffa23c4f13 100644 (file)
@@ -170,9 +170,8 @@ func sighandler(sig uint32, info *siginfo, ctxt unsafe.Pointer, gp *g) {
 
        if docrash {
                // TODO(rsc): Implement raiseproc on other systems
-               // and then add to this switch.
-               switch GOOS {
-               case "darwin", "linux":
+               // and then add to this if condition.
+               if GOOS == "darwin" || GOOS == "linux" {
                        crashing++
                        if crashing < sched.mcount {
                                // There are other m's that need to dump their stacks.