]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix windows-amd64-2012 build
authorRuss Cox <rsc@golang.org>
Fri, 10 May 2019 15:13:06 +0000 (11:13 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 10 May 2019 16:16:30 +0000 (16:16 +0000)
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 <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/os_windows.go
src/runtime/sys_windows_amd64.s

index 4d051a246ab0b98d06ceffc32d7bcb09fd2d6428..074ae0f40de8a66444b02d2feea005d913aa9e2d 100644 (file)
@@ -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
index 39ebe1bdf9b6568153c72dbca9bb26134d73ee15..2aea8eaff7ec15eb93d84fe39ebe2701a4c48b06 100644 (file)
@@ -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)