]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: don't track same node twice in guessKinds
authorHiroshi Ioka <hirochachacha@gmail.com>
Thu, 2 Feb 2017 12:53:52 +0000 (21:53 +0900)
committerIan Lance Taylor <iant@golang.org>
Thu, 2 Feb 2017 17:20:37 +0000 (17:20 +0000)
Change-Id: Ib2c1490a42e3485913a05a0b2fecdcc425d42871
Reviewed-on: https://go-review.googlesource.com/36083
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/cgo/gcc.go

index 5ea2d941ca2ea9f9609c2c3531f7373ebd31aeb4..a740748d2fd88e21b42a72620bd3d74e4a7c49a5 100644 (file)
@@ -269,11 +269,10 @@ func (p *Package) guessKinds(f *File) []*Name {
                        }
                }
 
-               needType = append(needType, n)
-
                // If this is a struct, union, or enum type name, no need to guess the kind.
                if strings.HasPrefix(n.C, "struct ") || strings.HasPrefix(n.C, "union ") || strings.HasPrefix(n.C, "enum ") {
                        n.Kind = "type"
+                       needType = append(needType, n)
                        continue
                }