go/ast: FuncType.Params may be nil (per AST documentation)

ast.Walk needs to check for it or it will crash.

R=r
CC=golang-dev
https://golang.org/cl/6852062
This commit is contained in:
Robert Griesemer 2012-11-16 11:53:26 -08:00
parent 8f82bff545
commit a42e8a8086
1 changed files with 3 additions and 1 deletions

View File

@ -158,7 +158,9 @@ func Walk(v Visitor, node Node) {
Walk(v, n.Fields)
case *FuncType:
Walk(v, n.Params)
if n.Params != nil {
Walk(v, n.Params)
}
if n.Results != nil {
Walk(v, n.Results)
}