mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: call cgocallbackg indirectly
cgocallback calls cgocallbackg after switching the stack. Call it indirectly to bypass the linker's nosplit check. Apparently (at least on Windows) cgocallbackg can use quite a bit stack space in a nosplit chain. We have been running over the nosplit limit, or very close to the limit. Since it switches stack in cgocallback, it is not meaningful to count frames above cgocallback and below cgocallbackg together. Bypass the check. For #45658. Change-Id: Ie22017e3f82d2c1fcc37336696f2d02757856399 Reviewed-on: https://go-review.googlesource.com/c/go/+/312669 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
d5b2d809b0
commit
d3853fb4e6
1 changed files with 2 additions and 1 deletions
|
|
@ -911,7 +911,8 @@ havem:
|
||||||
MOVQ BX, 0(SP)
|
MOVQ BX, 0(SP)
|
||||||
MOVQ CX, 8(SP)
|
MOVQ CX, 8(SP)
|
||||||
MOVQ DX, 16(SP)
|
MOVQ DX, 16(SP)
|
||||||
CALL runtime·cgocallbackg(SB)
|
MOVQ $runtime·cgocallbackg(SB), AX
|
||||||
|
CALL AX // indirect call to bypass nosplit check. We're on a different stack now.
|
||||||
|
|
||||||
// Compute the size of the frame again. FP and SP have
|
// Compute the size of the frame again. FP and SP have
|
||||||
// completely different values here than they did above,
|
// completely different values here than they did above,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue