summaryrefslogtreecommitdiffstats
path: root/Tools/peg_generator
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-05-08 02:38:44 (GMT)
committerGitHub <noreply@github.com>2020-05-08 02:38:44 (GMT)
commitdb9163ceef31ba00ccb23226917f9c8e9142a0b8 (patch)
treedb8ef3bf719774bf6d1f0aab96f1cf65403a77b7 /Tools/peg_generator
parentb7a78ca74ab539943ab11b5c4c9cfab7f5b7ff5a (diff)
downloadcpython-db9163ceef31ba00ccb23226917f9c8e9142a0b8.zip
cpython-db9163ceef31ba00ccb23226917f9c8e9142a0b8.tar.gz
cpython-db9163ceef31ba00ccb23226917f9c8e9142a0b8.tar.bz2
bpo-40555: Check for p->error_indicator in loop rules after the main loop is done (GH-19986)
Diffstat (limited to 'Tools/peg_generator')
-rw-r--r--Tools/peg_generator/pegen/c_generator.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py
index 3bf6d9e..b7a9942 100644
--- a/Tools/peg_generator/pegen/c_generator.py
+++ b/Tools/peg_generator/pegen/c_generator.py
@@ -525,7 +525,7 @@ class CParserGenerator(ParserGenerator, GrammarVisitor):
rulename=node.name if memoize else None,
)
if is_repeat1:
- self.print("if (n == 0) {")
+ self.print("if (n == 0 || p->error_indicator) {")
with self.indent():
self.print("PyMem_Free(children);")
self.print("return NULL;")