From 053127b12f4ad04417f3d26b0acbf91e9a9c1a6a Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Wed, 12 Mar 2014 07:21:55 +1100 Subject: [PATCH] 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 --- src/pkg/runtime/{signal_amd64.c => signal_amd64x.c} | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) rename src/pkg/runtime/{signal_amd64.c => signal_amd64x.c} (96%) diff --git a/src/pkg/runtime/signal_amd64.c b/src/pkg/runtime/signal_amd64x.c similarity index 96% rename from src/pkg/runtime/signal_amd64.c rename to src/pkg/runtime/signal_amd64x.c index 01af0e7edf1..871891ad186 100644 --- a/src/pkg/runtime/signal_amd64.c +++ b/src/pkg/runtime/signal_amd64x.c @@ -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; }