mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
exp/types: fix crash in parseBasicType on unknown type
R=gri CC=golang-dev https://golang.org/cl/5302044
This commit is contained in:
parent
ec0b5533c9
commit
bb8c4ed22a
|
@ -289,9 +289,10 @@ func (p *gcParser) parseExportedName() (*ast.Object, string) {
|
|||
// BasicType = identifier .
|
||||
//
|
||||
func (p *gcParser) parseBasicType() Type {
|
||||
obj := Universe.Lookup(p.expect(scanner.Ident))
|
||||
id := p.expect(scanner.Ident)
|
||||
obj := Universe.Lookup(id)
|
||||
if obj == nil || obj.Kind != ast.Typ {
|
||||
p.errorf("not a basic type: %s", obj.Name)
|
||||
p.errorf("not a basic type: %s", id)
|
||||
}
|
||||
return obj.Type.(Type)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue