]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix nacl/amd64p32 signal handling
authorDave Cheney <dave@cheney.net>
Tue, 11 Mar 2014 20:21:55 +0000 (07:21 +1100)
committerDave Cheney <dave@cheney.net>
Tue, 11 Mar 2014 20:21:55 +0000 (07:21 +1100)
The change to signal_amd64.c from CL 15790043 was not merged correctly.

This CL reapplies the change, renaming the file to signal_amd64x.c and adds the appropriate build tags.

LGTM=iant, bradfitz
R=rsc, iant, bradfitz
CC=golang-codereviews
https://golang.org/cl/72790043

src/pkg/runtime/signal_amd64x.c [moved from src/pkg/runtime/signal_amd64.c with 96% similarity]

similarity index 96%
rename from src/pkg/runtime/signal_amd64.c
rename to src/pkg/runtime/signal_amd64x.c
index 01af0e7edf1ffa44dbf09c010e2f15b1f3d01831..871891ad186d86fcd9a5a8f4bd9c98f5407b8c48 100644 (file)
@@ -2,7 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build darwin dragonfly freebsd linux netbsd openbsd solaris
+// +build amd64 amd64p32
+// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
 
 #include "runtime.h"
 #include "defs_GOOS_GOARCH.h"
@@ -89,6 +90,8 @@ runtime·sighandler(int32 sig, Siginfo *info, void *ctxt, G *gp)
                // won't get to see who faulted.)
                if(SIG_RIP(info, ctxt) != 0) {
                        sp = (uintptr*)SIG_RSP(info, ctxt);
+                       if(sizeof(uintreg) > sizeof(uintptr))
+                               *--sp = 0;
                        *--sp = SIG_RIP(info, ctxt);
                        SIG_RSP(info, ctxt) = (uintptr)sp;
                }