mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
godoc: fix crash in -analysis
Fixes golang/go#20641 Change-Id: I499b4b8da2899c4b606ce3eedd30caab57607a85 Reviewed-on: https://go-review.googlesource.com/45570 Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
011098bb92
commit
5d733ef37e
@ -299,7 +299,7 @@ type analysis struct {
|
||||
result *Result
|
||||
prog *ssa.Program
|
||||
ops []chanOp // all channel ops in program
|
||||
allNamed []*types.Named // all named types in the program
|
||||
allNamed []*types.Named // all "defined" (formerly "named") types in the program
|
||||
ptaConfig pointer.Config
|
||||
path2url map[string]string // maps openable path to godoc file URL (/src/fmt/print.go)
|
||||
pcgs map[*ssa.Package]*packageCallGraph
|
||||
@ -475,7 +475,9 @@ func Run(pta bool, result *Result) {
|
||||
for _, info := range iprog.AllPackages {
|
||||
for _, obj := range info.Defs {
|
||||
if obj, ok := obj.(*types.TypeName); ok {
|
||||
a.allNamed = append(a.allNamed, obj.Type().(*types.Named))
|
||||
if named, ok := obj.Type().(*types.Named); ok {
|
||||
a.allNamed = append(a.allNamed, named)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user