From: Devon H. O'Dell Date: Wed, 23 Dec 2009 17:26:21 +0000 (-0800) Subject: cgo: don't overwrite p.Crefs X-Git-Tag: weekly.2010-01-05~47 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7c9111434a6ef6ee8fb01fcdda28bd4f935ddbd3;p=gostls13.git cgo: don't overwrite p.Crefs It's expected to be shared between all files so that all types are output. Fixes bug reported on mailing list by Peter Froehlich. R=rsc, phf CC=golang-dev https://golang.org/cl/183043 --- diff --git a/src/cmd/cgo/ast.go b/src/cmd/cgo/ast.go index 76ff9ec653..c78d8bb8e6 100644 --- a/src/cmd/cgo/ast.go +++ b/src/cmd/cgo/ast.go @@ -118,7 +118,9 @@ func openProg(name string, p *Prog) { } // Accumulate pointers to uses of C.x. - p.Crefs = make([]*Cref, 0, 8) + if p.Crefs == nil { + p.Crefs = make([]*Cref, 0, 8) + } walk(p.AST, p, "prog") }