Commit b2a9079e authored by Shenghou Ma's avatar Shenghou Ma

runtime: manage stack by ourselves for badcallback on windows/amd64

This function uses 48-byte of precious non-split stack for every callback
function, and without this CL, it can easily overflow the non-split stack.
I encountered this when trying to enable misc/cgo/test on windows/amd64.

R=rsc
CC=golang-dev
https://golang.org/cl/5784075
parent 1ddc9feb
...@@ -60,7 +60,11 @@ loadregs: ...@@ -60,7 +60,11 @@ loadregs:
RET RET
TEXT runtime·badcallback(SB),7,$48 // This should be called on a system stack,
// so we don't need to concern about split stack.
TEXT runtime·badcallback(SB),7,$0
SUBQ $48, SP
// stderr // stderr
MOVQ $-12, CX // stderr MOVQ $-12, CX // stderr
MOVQ CX, 0(SP) MOVQ CX, 0(SP)
...@@ -80,6 +84,7 @@ TEXT runtime·badcallback(SB),7,$48 ...@@ -80,6 +84,7 @@ TEXT runtime·badcallback(SB),7,$48
MOVQ runtime·WriteFile(SB), AX MOVQ runtime·WriteFile(SB), AX
CALL AX CALL AX
ADDQ $48, SP
RET RET
TEXT runtime·badsignal(SB),7,$48 TEXT runtime·badsignal(SB),7,$48
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment