Commit 7c911143 authored by Devon H. O'Dell's avatar Devon H. O'Dell Committed by Russ Cox

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
parent 3f25c8a2
...@@ -118,7 +118,9 @@ func openProg(name string, p *Prog) { ...@@ -118,7 +118,9 @@ func openProg(name string, p *Prog) {
} }
// Accumulate pointers to uses of C.x. // 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") walk(p.AST, p, "prog")
} }
......
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