1
0
mirror of https://github.com/golang/go synced 2024-11-12 06:20:22 -07:00

runtime: fix nacl/amd64p32 signal handling

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
This commit is contained in:
Dave Cheney 2014-03-12 07:21:55 +11:00
parent 2d9fab905b
commit 053127b12f

View File

@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // 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 "runtime.h"
#include "defs_GOOS_GOARCH.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.) // won't get to see who faulted.)
if(SIG_RIP(info, ctxt) != 0) { if(SIG_RIP(info, ctxt) != 0) {
sp = (uintptr*)SIG_RSP(info, ctxt); sp = (uintptr*)SIG_RSP(info, ctxt);
if(sizeof(uintreg) > sizeof(uintptr))
*--sp = 0;
*--sp = SIG_RIP(info, ctxt); *--sp = SIG_RIP(info, ctxt);
SIG_RSP(info, ctxt) = (uintptr)sp; SIG_RSP(info, ctxt) = (uintptr)sp;
} }