From: Shenghou Ma Date: Thu, 10 Jul 2014 03:55:35 +0000 (-0400) Subject: runtime: ignore exceptions from foreign threads. X-Git-Tag: go1.4beta1~1126 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a1778ec1462c2f3f8865e02e5fd7e72ee25c2b64;p=gostls13.git runtime: ignore exceptions from foreign threads. Fixes #8224. LGTM=alex.brainman, rsc R=alex.brainman, rsc, dave CC=golang-codereviews https://golang.org/cl/104200046 --- diff --git a/src/pkg/runtime/sys_windows_386.s b/src/pkg/runtime/sys_windows_386.s index dc6fc39ddb..f2c2a4128c 100644 --- a/src/pkg/runtime/sys_windows_386.s +++ b/src/pkg/runtime/sys_windows_386.s @@ -88,6 +88,10 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0-0 // fetch g get_tls(DX) + CMPL DX, $0 + JNE 3(PC) + MOVL $0, AX // continue + JMP done MOVL g(DX), DX CMPL DX, $0 JNE 2(PC) @@ -99,6 +103,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0-0 CALL runtime·sighandler(SB) // AX is set to report result back to Windows +done: // restore callee-saved registers MOVL 24(SP), DI MOVL 20(SP), SI diff --git a/src/pkg/runtime/sys_windows_amd64.s b/src/pkg/runtime/sys_windows_amd64.s index c3db2c1f83..72b905ef79 100644 --- a/src/pkg/runtime/sys_windows_amd64.s +++ b/src/pkg/runtime/sys_windows_amd64.s @@ -120,6 +120,10 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0-0 // fetch g get_tls(DX) + CMPQ DX, $0 + JNE 3(PC) + MOVQ $0, AX // continue + JMP done MOVQ g(DX), DX CMPQ DX, $0 JNE 2(PC) @@ -131,6 +135,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0-0 CALL runtime·sighandler(SB) // AX is set to report result back to Windows +done: // restore registers as required for windows callback MOVQ 24(SP), R15 MOVQ 32(SP), R14