From: Robert Griesemer Date: Fri, 12 Mar 2010 01:39:55 +0000 (-0800) Subject: ast/filter.go: missing nil-check causes crash X-Git-Tag: weekly.2010-03-15~8 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f7c27b9af9823baad0c2bb34d036d8991ac587e6;p=gostls13.git ast/filter.go: missing nil-check causes crash R=rsc CC=golang-dev https://golang.org/cl/461041 --- diff --git a/src/pkg/go/ast/filter.go b/src/pkg/go/ast/filter.go index 1c2aea3574..4e2060303b 100644 --- a/src/pkg/go/ast/filter.go +++ b/src/pkg/go/ast/filter.go @@ -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