}
fn.Func.SetNilCheckDisabled(true)
- funccompile(fn)
+ xtop = append(xtop, fn)
// Build closure. It doesn't close over any variables, so
// it contains just the function pointer.
// neither of which can be nil, and our comparisons
// are shallow.
fn.Func.SetNilCheckDisabled(true)
- funccompile(fn)
+ xtop = append(xtop, fn)
// Generate a closure which points at the function we just generated.
dsymptr(closure, 0, sym.Linksym(), 0)
func dumpdata() {
externs := len(externdcl)
+ xtops := len(xtop)
dumpglobls()
addptabs()
+ exportlistLen := len(exportlist)
addsignats(externdcl)
dumpsignats()
dumptabs()
+ ptabsLen := len(ptabs)
+ itabsLen := len(itabs)
dumpimportstrings()
dumpbasictypes()
// number of types in a finite amount of code.
// In the typical case, we loop 0 or 1 times.
// It was not until issue 24761 that we found any code that required a loop at all.
- for len(compilequeue) > 0 {
+ for {
+ for i := xtops; i < len(xtop); i++ {
+ n := xtop[i]
+ if n.Op == ODCLFUNC {
+ funccompile(n)
+ }
+ }
+ xtops = len(xtop)
compileFunctions()
dumpsignats()
+ if xtops == len(xtop) {
+ break
+ }
}
// Dump extra globals.
}
addGCLocals()
+
+ if exportlistLen != len(exportlist) {
+ Fatalf("exportlist changed after compile functions loop")
+ }
+ if ptabsLen != len(ptabs) {
+ Fatalf("ptabs changed after compile functions loop")
+ }
+ if itabsLen != len(itabs) {
+ Fatalf("itabs changed after compile functions loop")
+ }
}
func dumpLinkerObj(bout *bio.Writer) {