From: Russ Cox Date: Fri, 10 May 2019 15:13:06 +0000 (-0400) Subject: runtime: fix windows-amd64-2012 build X-Git-Tag: go1.13beta1~338 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ef4666eccedd457b33baa5b7d4bff95680e60741;p=gostls13.git runtime: fix windows-amd64-2012 build I forgot that in Go assembly, x+16(SP) is not the same as 16(SP). The former is the virtual stack pointer (one word below FP on x86) while the latter is the actual stack pointer. Change-Id: Ibb7012bb97261949f5e1a0dc70869d9a6f50aa99 Reviewed-on: https://go-review.googlesource.com/c/go/+/176557 Run-TryBot: Russ Cox Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/os_windows.go b/src/runtime/os_windows.go index 4d051a246a..074ae0f40d 100644 --- a/src/runtime/os_windows.go +++ b/src/runtime/os_windows.go @@ -135,7 +135,8 @@ var ( // to start new os thread. func tstart_stdcall(newm *m) -func ctrlhandler(_type uint32) +// Called by OS using stdcall ABI. +func ctrlhandler() type mOS struct { waitsema uintptr // semaphore for parking on locks diff --git a/src/runtime/sys_windows_amd64.s b/src/runtime/sys_windows_amd64.s index 39ebe1bdf9..2aea8eaff7 100644 --- a/src/runtime/sys_windows_amd64.s +++ b/src/runtime/sys_windows_amd64.s @@ -211,7 +211,7 @@ TEXT runtime·lastcontinuetramp(SB),NOSPLIT|NOFRAME,$0-0 JMP sigtramp<>(SB) TEXT runtime·ctrlhandler(SB),NOSPLIT|NOFRAME,$8 - MOVQ CX, _type+16(SP) // spill + MOVQ CX, 16(SP) // spill MOVQ $runtime·ctrlhandler1(SB), CX MOVQ CX, 0(SP) CALL runtime·externalthreadhandler(SB)