Commit ab16ccc1 authored by Tim Hockin's avatar Tim Hockin

go2idl: don't mutate a map being iterated

This was causing us to process packages we didn't really want, which was only visible when debugging was enabled.
parent 96c0284e
......@@ -337,7 +337,13 @@ func (b *Builder) typeCheckPackage(id string) (*tc.Package, error) {
func (b *Builder) makePackages() error {
b.pkgs = map[string]*tc.Package{}
// Take a snapshot to iterate, since this will recursively mutate b.parsed.
keys := []string{}
for id := range b.parsed {
keys = append(keys, id)
}
for _, id := range keys {
// We have to check here even though we made a new one above,
// because typeCheckPackage follows the import graph, which may
// cause a package to be filled before we get to it in this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment