mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: fix windows/amd64 build
Out of stack space due to new 2-word call in freedefer. Go back to smaller function calls. TBR=brainman CC=golang-codereviews https://golang.org/cl/152340043
This commit is contained in:
parent
2b1659b57d
commit
f950a14bb5
1 changed files with 8 additions and 2 deletions
|
|
@ -189,8 +189,7 @@ func newdefer(siz int32) *_defer {
|
||||||
//go:nosplit
|
//go:nosplit
|
||||||
func freedefer(d *_defer) {
|
func freedefer(d *_defer) {
|
||||||
if d._panic != nil {
|
if d._panic != nil {
|
||||||
// _panic must be cleared before d is unlinked from gp.
|
freedeferpanic()
|
||||||
gothrow("freedefer with d._panic != nil")
|
|
||||||
}
|
}
|
||||||
sc := deferclass(uintptr(d.siz))
|
sc := deferclass(uintptr(d.siz))
|
||||||
if sc < uintptr(len(p{}.deferpool)) {
|
if sc < uintptr(len(p{}.deferpool)) {
|
||||||
|
|
@ -203,6 +202,13 @@ func freedefer(d *_defer) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Separate function so that it can split stack.
|
||||||
|
// Windows otherwise runs out of stack space.
|
||||||
|
func freedeferpanic() {
|
||||||
|
// _panic must be cleared before d is unlinked from gp.
|
||||||
|
gothrow("freedefer with d._panic != nil")
|
||||||
|
}
|
||||||
|
|
||||||
// Run a deferred function if there is one.
|
// Run a deferred function if there is one.
|
||||||
// The compiler inserts a call to this at the end of any
|
// The compiler inserts a call to this at the end of any
|
||||||
// function which calls defer.
|
// function which calls defer.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue