summaryrefslogtreecommitdiff
path: root/src/pkg/go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2010-03-11 17:39:55 -0800
committerRobert Griesemer <gri@golang.org>2010-03-11 17:39:55 -0800
commitd3ce02d22a8bac542efa9c8ce371cf2b14eb7204 (patch)
tree55e09b1b3e697da887fd970d4c476e3a19c34065 /src/pkg/go
parent08f4c5c4770c902d26699d2a4e45cecf41243abb (diff)
downloadgolang-d3ce02d22a8bac542efa9c8ce371cf2b14eb7204.tar.gz
ast/filter.go: missing nil-check causes crash
R=rsc CC=golang-dev http://codereview.appspot.com/461041
Diffstat (limited to 'src/pkg/go')
-rw-r--r--src/pkg/go/ast/filter.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/go/ast/filter.go b/src/pkg/go/ast/filter.go
index 1c2aea357..4e2060303 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