1
0
mirror of https://github.com/golang/go synced 2024-11-27 04:41:33 -07:00
go/test/fixedbugs/issue20780.go
Keith Randall 06b326054d cmd/compile: include callee args section when checking frame too large
The stack frame includes the callee args section. At the point where
we were checking the frame size, that part of the frame had not been
computed yet. Move the check later so we can include the callee args size.

Fixes #20780
Update #25507

Change-Id: Iab97cb89b3a24f8ca19b9123ef2a111d6850c3fe
Reviewed-on: https://go-review.googlesource.com/115195
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2018-06-02 18:00:44 +00:00

21 lines
534 B
Go

// errorcheck
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// We have a limit of 1GB for stack frames.
// Make sure we include the callee args section.
// (The dispatch wrapper which implements (*S).f
// copies the return value from f to a stack temp, then
// from that stack temp to the return value of (*S).f.
// It uses ~800MB for each section.)
package main
type S struct {
i interface {
f() [800e6]byte
}
}