]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: ignore exceptions from foreign threads.
authorShenghou Ma <minux@golang.org>
Thu, 10 Jul 2014 03:55:35 +0000 (23:55 -0400)
committerShenghou Ma <minux@golang.org>
Thu, 10 Jul 2014 03:55:35 +0000 (23:55 -0400)
Fixes #8224.

LGTM=alex.brainman, rsc
R=alex.brainman, rsc, dave
CC=golang-codereviews
https://golang.org/cl/104200046

src/pkg/runtime/sys_windows_386.s
src/pkg/runtime/sys_windows_amd64.s

index dc6fc39ddb02cdb2196e006c184037eb1df0729c..f2c2a4128caddd34f63d5bbaf2aa9c9632e817a5 100644 (file)
@@ -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
index c3db2c1f833fa76ec6f8e7280e4122906e60eb52..72b905ef7982d22c856b91aab06b4031f357cd50 100644 (file)
@@ -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