This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pablogsal
Recipients pablogsal
Date 2020-09-02.10:59:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1599044361.34.0.302314568095.issue41690@roundup.psfhosted.org>
In-reply-to
Content
This program can segfault the parser by stackoverflow:

import ast

code = "f(" + ",".join(['a' for _ in range(100000)]) + ")"
print("Ready!")
ast.parse(code)

the reason is that the rule for arguments has a simple recursion when collecting args:

args[expr_ty]:
    [...]
    | a=named_expression b=[',' c=args { c }] {
        [...] }

Check https://github.com/we-like-parsers/pegen/issues/245 for more context and informaton
History
Date User Action Args
2020-09-02 10:59:21pablogsalsetrecipients: + pablogsal
2020-09-02 10:59:21pablogsalsetmessageid: <1599044361.34.0.302314568095.issue41690@roundup.psfhosted.org>
2020-09-02 10:59:21pablogsallinkissue41690 messages
2020-09-02 10:59:21pablogsalcreate