mirror of
https://github.com/golang/go
synced 2024-11-18 00:34:44 -07:00
69d34e2c69
The previous array length was large enough to exceed maxImplicitStackSize on 64-bit architectures, but not on 32-bit architectures. Fixes #40808. Change-Id: I69e9abb447454b2e7875ba503a0cb772e965ae31 Reviewed-on: https://go-review.googlesource.com/c/go/+/248680 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
30 lines
570 B
Go
30 lines
570 B
Go
// errorcheck -0 -m -l
|
|
|
|
// Copyright 2020 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.
|
|
|
|
package p
|
|
|
|
type t [20000]*int
|
|
|
|
func (t) f() {
|
|
}
|
|
|
|
func x() {
|
|
x := t{}.f // ERROR "t literal.f escapes to heap"
|
|
x()
|
|
}
|
|
|
|
func y() {
|
|
var i int // ERROR "moved to heap: i"
|
|
y := (&t{&i}).f // ERROR "\(&t literal\).f escapes to heap" "&t literal escapes to heap"
|
|
y()
|
|
}
|
|
|
|
func z() {
|
|
var i int // ERROR "moved to heap: i"
|
|
z := t{&i}.f // ERROR "t literal.f escapes to heap"
|
|
z()
|
|
}
|