]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41215: Make assertion in the new parser more strict (GH-21364)
authorLysandros Nikolaou <lisandrosnik@gmail.com>
Mon, 6 Jul 2020 22:42:21 +0000 (01:42 +0300)
committerGitHub <noreply@github.com>
Mon, 6 Jul 2020 22:42:21 +0000 (01:42 +0300)
Parser/pegen.c

index 42f9e0c41bf49881ac51ef1037e46f03c16674bc..e2cbf8ba2461ce161ad6b82290e31fc4562beea5 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) {