]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41215: Make assertion in the new parser more strict (GH-21364)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 6 Jul 2020 23:35:10 +0000 (16:35 -0700)
committerGitHub <noreply@github.com>
Mon, 6 Jul 2020 23:35:10 +0000 (16:35 -0700)
(cherry picked from commit 782f44b8fb07ec33cee148b2b6b4cf53024fe0cd)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Parser/pegen/pegen.c

index 0f33dcba286adb116e3b7efcd8a92726783b60d9..beb2b2da5696d937169c3674d2659ab1142b7480 100644 (file)
@@ -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) {