From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 6 Jul 2020 23:35:10 +0000 (-0700) Subject: bpo-41215: Make assertion in the new parser more strict (GH-21364) X-Git-Tag: v3.9.0b5~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=edeaf61b6827ab3a8673aff1fb7717917f08f003;p=thirdparty%2FPython%2Fcpython.git bpo-41215: Make assertion in the new parser more strict (GH-21364) (cherry picked from commit 782f44b8fb07ec33cee148b2b6b4cf53024fe0cd) Co-authored-by: Lysandros Nikolaou --- diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 0f33dcba286a..beb2b2da5696 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/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) {