summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2020-07-06 22:42:21 (GMT)
committerGitHub <noreply@github.com>2020-07-06 22:42:21 (GMT)
commit782f44b8fb07ec33cee148b2b6b4cf53024fe0cd (patch)
treece5d417135686b3ca426695309d7fdf448a29789 /Parser
parentc2c1f1f906cdeb40576880d4b6a4f8fcbc016eb8 (diff)
downloadcpython-782f44b8fb07ec33cee148b2b6b4cf53024fe0cd.zip
cpython-782f44b8fb07ec33cee148b2b6b4cf53024fe0cd.tar.gz
cpython-782f44b8fb07ec33cee148b2b6b4cf53024fe0cd.tar.bz2
bpo-41215: Make assertion in the new parser more strict (GH-21364)
Diffstat (limited to 'Parser')
-rw-r--r--Parser/pegen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/pegen.c b/Parser/pegen.c
index 42f9e0c..e2cbf8b 100644
--- a/Parser/pegen.c
+++ b/Parser/pegen.c
@@ -525,7 +525,7 @@ _PyPegen_dummy_name(Parser *p, ...)
static int
_get_keyword_or_name_type(Parser *p, const char *name, int name_len)
{
- assert(name_len != 0);
+ assert(name_len > 0);
if (name_len >= p->n_keyword_lists ||
p->keywords[name_len] == NULL ||
p->keywords[name_len]->type == -1) {