Skip to content

Fix crash when function annotation has more args than function with fast parser #1812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2016

Conversation

ddfisher
Copy link
Collaborator

@ddfisher ddfisher commented Jul 6, 2016

We currently crash when we have a function type comment that has more arguments than the function itself when running with the fast parser. We actually already check for this error in two places: in the normal parser (which doesn't affect this case) and in the semantic analysis phase. When the error is caught in the normal parser, this aborts further processing (because it's considered a parse error). This PR makes the check in the semantic analysis phase produce a blocking error, which aborts further processing and prevents the crash later down the line (where the number of arguments is assumed to match).

@gvanrossum gvanrossum merged commit d86f5f6 into master Jul 6, 2016
@ddfisher ddfisher deleted the fast-parser-args branch July 7, 2016 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants