Message376225
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 |
|
Date |
User |
Action |
Args |
2020-09-02 10:59:21 | pablogsal | set | recipients:
+ pablogsal |
2020-09-02 10:59:21 | pablogsal | set | messageid: <1599044361.34.0.302314568095.issue41690@roundup.psfhosted.org> |
2020-09-02 10:59:21 | pablogsal | link | issue41690 messages |
2020-09-02 10:59:21 | pablogsal | create | |
|