diff options
author | Robert Griesemer <gri@golang.org> | 2012-11-16 11:53:26 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2012-11-16 11:53:26 -0800 |
commit | a1860f42d3b7c4705c801e46fd2e6e2a09a1643f (patch) | |
tree | 2fea0e912fa45007fc8a9129612b5f835ddc223c /src/pkg/go/ast | |
parent | 4f7dd459741d4188b6f324aee6fe447b162ddd33 (diff) | |
download | go-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.go | 4 |
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) } |