Skip to content

Commit

Permalink
Honor MaxImplements
Browse files Browse the repository at this point in the history
  • Loading branch information
nigeltao committed Jan 10, 2020
1 parent d307fe3 commit e9897f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lang/parse/parse.go
Expand Up @@ -263,6 +263,9 @@ func (p *parser) parseTopLevelDecl() (*a.Node, error) {
if err != nil {
return nil, err
}
if len(implements) > a.MaxImplements {
return nil, fmt.Errorf(`parse: too many implements listed at %s:%d`, p.filename, p.line())
}
}

fields, err := p.parseList(t.IDCloseParen, (*parser).parseFieldNode)
Expand Down

0 comments on commit e9897f6

Please sign in to comment.