summaryrefslogtreecommitdiff
path: root/src/pkg/go/ast
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2012-11-16 11:53:26 -0800
committerRobert Griesemer <gri@golang.org>2012-11-16 11:53:26 -0800
commita1860f42d3b7c4705c801e46fd2e6e2a09a1643f (patch)
tree2fea0e912fa45007fc8a9129612b5f835ddc223c /src/pkg/go/ast
parent4f7dd459741d4188b6f324aee6fe447b162ddd33 (diff)
downloadgo-a1860f42d3b7c4705c801e46fd2e6e2a09a1643f.tar.gz
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 http://codereview.appspot.com/6852062
Diffstat (limited to 'src/pkg/go/ast')
-rw-r--r--src/pkg/go/ast/walk.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pkg/go/ast/walk.go b/src/pkg/go/ast/walk.go
index 66b1dc249..fef2503c3 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)
}