File tree Expand file tree Collapse file tree
src/cmd/compile/internal/gc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,16 +144,17 @@ func dumpLinkerObj(bout *bio.Writer) {
144144 dumpimportstrings ()
145145 dumpbasictypes ()
146146
147- // The first call to dumpsignats can generate functions,
147+ // Calls to dumpsignats can generate functions,
148148 // like method wrappers and hash and equality routines.
149- compileFunctions ()
150-
151- // Process any new signats added during compilation.
152- // No need to loop here; signats from compiling the generated
153- // functions should not themselves generate new functions.
154- // If they do, we'll know about it; the sanity check of
155- // len(compilequeue) in gc.Main will fail.
156- dumpsignats ()
149+ // Compile any generated functions, process any new resulting types, repeat.
150+ // This can't loop forever, because there is no way to generate an infinite
151+ // number of types in a finite amount of code.
152+ // In the typical case, we loop 0 or 1 times.
153+ // It was not until issue 24761 that we found any code that required a loop at all.
154+ for len (compilequeue ) > 0 {
155+ compileFunctions ()
156+ dumpsignats ()
157+ }
157158
158159 // Dump extra globals.
159160 tmp := externdcl
Original file line number Diff line number Diff line change 1+ // Copyright 2018 The Go Authors. All rights reserved.
2+ // Use of this source code is governed by a BSD-style
3+ // license that can be found in the LICENSE file.
4+
5+ package a
6+
7+ type T2 struct {}
8+
9+ func (t * T2 ) M2 (a , b float64 ) {
10+ variadic (a , b )
11+ }
12+
13+ func variadic (points ... float64 ) {
14+ println (points )
15+ }
Original file line number Diff line number Diff line change 1+ // Copyright 2018 The Go Authors. All rights reserved.
2+ // Use of this source code is governed by a BSD-style
3+ // license that can be found in the LICENSE file.
4+
5+ package b
6+
7+ import "./a"
8+
9+ type T1 struct {
10+ * a.T2
11+ }
Original file line number Diff line number Diff line change 1+ // compiledir -c=4
2+
3+ // Copyright 2018 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.
6+
7+ package ignored
You can’t perform that action at this time.
0 commit comments