3 // Copyright 2015 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // issue 10253: cmd/gc: incorrect escape analysis of closures
8 // Partial call x.foo was not promoted to heap.
14 // Create a new goroutine to get a default-size stack segment.
28 func clos(x func()) func() {
31 x() // This statement crashed, because the partial call was allocated on the old stack.
33 // Grow stack so that partial call x becomes invalid if allocated on stack.
36 // Spoil the previous stack segment.
44 func growstack(x int) {