Commit bb8c4ed2 authored by Russ Cox's avatar Russ Cox

exp/types: fix crash in parseBasicType on unknown type

R=gri
CC=golang-dev
https://golang.org/cl/5302044
parent ec0b5533
...@@ -289,9 +289,10 @@ func (p *gcParser) parseExportedName() (*ast.Object, string) { ...@@ -289,9 +289,10 @@ func (p *gcParser) parseExportedName() (*ast.Object, string) {
// BasicType = identifier . // BasicType = identifier .
// //
func (p *gcParser) parseBasicType() Type { 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 { 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) return obj.Type.(Type)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment