]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: properly restore registers in Solaris runtime·sigtramp
authorAram Hăvărneanu <aram@mgk.ro>
Tue, 1 Jul 2014 23:34:06 +0000 (09:34 +1000)
committerDave Cheney <dave@cheney.net>
Tue, 1 Jul 2014 23:34:06 +0000 (09:34 +1000)
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

index dd34e24d01147ec0c5b91eba241edd33b5ef0621..83e8dfac562e66e74a7cf7e187a1a2e15463b332 100644 (file)
@@ -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