Commit f7c27b9a authored by Robert Griesemer's avatar Robert Griesemer

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

R=rsc
CC=golang-dev
https://golang.org/cl/461041
parent 3e24f2d6
......@@ -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
......
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