]> Cypherpunks repositories - gostls13.git/commitdiff
go/ast: FuncType.Params may be nil (per AST documentation)
authorRobert Griesemer <gri@golang.org>
Fri, 16 Nov 2012 19:53:26 +0000 (11:53 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 16 Nov 2012 19:53:26 +0000 (11:53 -0800)
ast.Walk needs to check for it or it will crash.

R=r
CC=golang-dev
https://golang.org/cl/6852062

src/pkg/go/ast/walk.go

index 66b1dc2499b986d54684428e47db256a00288ac9..fef2503c37e8baa3c7b3d92627bc6ec5b7af89e9 100644 (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)
                }