Skip to content

Commit ef4666e

Browse files
committed
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 <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 1d1ff46 commit ef4666e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/runtime/os_windows.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ var (
135135
// to start new os thread.
136136
func tstart_stdcall(newm *m)
137137

138-
func ctrlhandler(_type uint32)
138+
// Called by OS using stdcall ABI.
139+
func ctrlhandler()
139140

140141
type mOS struct {
141142
waitsema uintptr // semaphore for parking on locks

src/runtime/sys_windows_amd64.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ TEXT runtime·lastcontinuetramp(SB),NOSPLIT|NOFRAME,$0-0
211211
JMP sigtramp<>(SB)
212212

213213
TEXT runtime·ctrlhandler(SB),NOSPLIT|NOFRAME,$8
214-
MOVQ CX, _type+16(SP) // spill
214+
MOVQ CX, 16(SP) // spill
215215
MOVQ $runtime·ctrlhandler1(SB), CX
216216
MOVQ CX, 0(SP)
217217
CALL runtime·externalthreadhandler(SB)

0 commit comments

Comments
 (0)