mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
bpo-46110: Add a recursion check to avoid stack overflow in the PEG parser (GH-30177)
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
This commit is contained in:
parent
6ca78affc8
commit
e9898bf153
5 changed files with 4602 additions and 3197 deletions
7773
Parser/parser.c
7773
Parser/parser.c
File diff suppressed because it is too large
Load diff
|
@ -815,6 +815,7 @@ void *
|
|||
_PyPegen_run_parser(Parser *p)
|
||||
{
|
||||
void *res = _PyPegen_parse(p);
|
||||
assert(p->level == 0);
|
||||
if (res == NULL) {
|
||||
if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_SyntaxError)) {
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue