commit | 782f44b8fb07ec33cee148b2b6b4cf53024fe0cd | [log] [tgz] |
---|---|---|
author | Lysandros Nikolaou <lisandrosnik@gmail.com> | Tue Jul 07 01:42:21 2020 +0300 |
committer | GitHub <noreply@github.com> | Tue Jul 07 01:42:21 2020 +0300 |
tree | ce5d417135686b3ca426695309d7fdf448a29789 | |
parent | c2c1f1f906cdeb40576880d4b6a4f8fcbc016eb8 [diff] [blame] |
bpo-41215: Make assertion in the new parser more strict (GH-21364)
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 @@ 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) {