3 // Copyright 2014 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 // The liveness code used to say that, in func g, s was live
8 // starting at its declaration, because it appears to have its
9 // address taken by the closure (different s, but the parser
10 // gets slightly confused, a separate bug). The liveness analysis
11 // saw s as having its address taken but the register optimizer
12 // did not. This mismatch meant that s would be marked live
13 // (and therefore initialized) at the call to f, but the register optimizer
14 // would optimize away the initialization of s before f, causing the
15 // garbage collector to use unused data.
16 // The register optimizer has been changed to respect the
17 // same "address taken" flag that the liveness analysis uses,
18 // even if it cannot see any address being taken in the actual
19 // machine code. This is conservative but keeps the two consistent,
20 // which is the most important thing.
27 func f() interface{} {
45 func useiface(x interface{}) {
62 func useint(x uintptr) {
66 // scribble non-zero values on stack
68 // call function that used to let the garbage collector
69 // see uninitialized stack values; it will see the