]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1] go/printer: don't crash if ast.FuncType.Params is nil
authorRobert Griesemer <gri@golang.org>
Fri, 21 Sep 2012 19:54:14 +0000 (05:54 +1000)
committerRobert Griesemer <gri@golang.org>
Fri, 21 Sep 2012 19:54:14 +0000 (05:54 +1000)
commit0db8f6814b56a2e236420944de3fbbb3f4c115b5
tree7e00c9125d8cb90ee8c105f8a8df77c5482dbfcf
parentc9cf888cd20e3fce089852bff05751b4c69e8bcd
[release-branch.go1] go/printer: don't crash if ast.FuncType.Params is nil

««« backport 7f6a0510d3c9
go/printer: don't crash if ast.FuncType.Params is nil

The go/ast comment for FuncType.Params says that the field may be nil.
Make sure the printer accepts such a value. The go/parser always sets
the field (to provide parenthesis position information), but a program
creating a Go AST from scatch may not.

Added corresponding test case.

Fixes #3870.

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

»»»
src/pkg/go/printer/nodes.go
src/pkg/go/printer/printer_test.go