summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-08-22 10:02:32 (GMT)
committerGitHub <noreply@github.com>2023-08-22 10:02:32 (GMT)
commit149d70c2546d9615e6292135430795c3cf2b50fe (patch)
tree6c5600f41665a16bb0fc6ac27ff5407fd384247b /Tools
parentef4d427fd8ed89fcfb5a0fada4c24abec12991e5 (diff)
downloadcpython-149d70c2546d9615e6292135430795c3cf2b50fe.zip
cpython-149d70c2546d9615e6292135430795c3cf2b50fe.tar.gz
cpython-149d70c2546d9615e6292135430795c3cf2b50fe.tar.bz2
[3.12] gh-108179: Add error message for parser stack overflows (GH-108256) (#108263)
gh-108179: Add error message for parser stack overflows (GH-108256) (cherry picked from commit 86617518c4ac824e2b6dc20691ba5a08df04f285) Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
Diffstat (limited to 'Tools')
-rw-r--r--Tools/peg_generator/pegen/c_generator.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py
index f57b627..301949b 100644
--- a/Tools/peg_generator/pegen/c_generator.py
+++ b/Tools/peg_generator/pegen/c_generator.py
@@ -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: