mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-108179: Add error message for parser stack overflows (#108256)
This commit is contained in:
parent
7f87ebbc3f
commit
86617518c4
5 changed files with 542 additions and 1063 deletions
|
@ -375,8 +375,7 @@ class CParserGenerator(ParserGenerator, GrammarVisitor):
|
|||
def add_level(self) -> None:
|
||||
self.print("if (p->level++ == MAXSTACK) {")
|
||||
with self.indent():
|
||||
self.print("p->error_indicator = 1;")
|
||||
self.print("PyErr_NoMemory();")
|
||||
self.print("_Pypegen_stack_overflow(p);")
|
||||
self.print("}")
|
||||
|
||||
def remove_level(self) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue