From: Robert Griesemer Date: Fri, 16 Nov 2012 19:53:26 +0000 (-0800) Subject: go/ast: FuncType.Params may be nil (per AST documentation) X-Git-Tag: go1.1rc2~1855 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a42e8a80864281807384a6e5a45bebf3327a53fe;p=gostls13.git 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 --- diff --git a/src/pkg/go/ast/walk.go b/src/pkg/go/ast/walk.go index 66b1dc2499..fef2503c37 100644 --- a/src/pkg/go/ast/walk.go +++ b/src/pkg/go/ast/walk.go @@ -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) }