cmd/compile: make compilation deterministic, fixes toolstash

Make sure we don't depend on map iterator order.

Fixes #14600

Change-Id: Iac0e0c8689f3ace7a4dc8e2127e2fd3c8545bd29
Reviewed-on: https://go-review.googlesource.com/20158
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Keith Randall 2016-03-03 09:53:03 -08:00
parent c03ed491fe
commit 686fbdb3b0
2 changed files with 16 additions and 8 deletions

View file

@ -143,7 +143,7 @@ func fprintFunc(p funcPrinter, f *Func) {
p.endBlock(b)
}
for name, vals := range f.NamedValues {
p.named(name, vals)
for _, name := range f.Names {
p.named(name, f.NamedValues[name])
}
}