1
0
mirror of https://github.com/golang/go synced 2024-11-20 06:54:42 -07:00

ast/filter.go: missing nil-check causes crash

R=rsc
CC=golang-dev
https://golang.org/cl/461041
This commit is contained in:
Robert Griesemer 2010-03-11 17:39:55 -08:00
parent 3e24f2d6df
commit f7c27b9af9

View File

@ -293,7 +293,7 @@ func MergePackageFiles(pkg *Package, complete bool) *File {
name := f.Name.Name()
if j, exists := funcs[name]; exists {
// function declared already
if decls[j].(*FuncDecl).Doc == nil {
if decls[j] != nil && decls[j].(*FuncDecl).Doc == nil {
// existing declaration has no documentation;
// ignore the existing declaration
decls[j] = nil