1
0
mirror of https://github.com/golang/go synced 2024-11-17 23:04:56 -07:00

cgo: fix index-out-of-bounds bug

R=rsc
CC=golang-dev
https://golang.org/cl/4284057
This commit is contained in:
Robert Griesemer 2011-03-18 12:38:38 -07:00
parent 3a6c0990a4
commit 3be0921e73

View File

@ -180,7 +180,7 @@ func (f *File) saveExport(x interface{}, context string) {
return
}
for _, c := range n.Doc.List {
if string(c.Text[0:9]) != "//export " {
if !strings.HasPrefix(string(c.Text), "//export ") {
continue
}