From d7b678b2ca26928390078c29e3f71868e867a182 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aram=20H=C4=83v=C4=83rneanu?= Date: Wed, 2 Jul 2014 09:34:06 +1000 Subject: [PATCH] =?utf8?q?runtime:=20properly=20restore=20registers=20in?= =?utf8?q?=20Solaris=20runtime=C2=B7sigtramp?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We restored registers correctly in the usual case where the thread is a Go-managed thread and called runtime·sighandler, but we failed to do so when runtime·sigtramp was called on a cgo-created thread. In that case, runtime·sigtramp called runtime·badsignal, a Go function, and did not restore registers after it returned LGTM=rsc, dave R=rsc, dave CC=golang-codereviews, minux.ma https://golang.org/cl/105280050 --- src/pkg/runtime/sys_solaris_amd64.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkg/runtime/sys_solaris_amd64.s b/src/pkg/runtime/sys_solaris_amd64.s index dd34e24d01..83e8dfac56 100644 --- a/src/pkg/runtime/sys_solaris_amd64.s +++ b/src/pkg/runtime/sys_solaris_amd64.s @@ -164,7 +164,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0 MOVQ DI, 0(SP) MOVQ $runtime·badsignal(SB), AX CALL AX - RET + JMP exit allgood: // save g @@ -259,6 +259,7 @@ allgood: MOVQ 80(SP), R10 MOVQ R10, g(BX) +exit: // restore registers MOVQ 32(SP), BX MOVQ 40(SP), BP -- 2.48.1