mirror of https://github.com/python/cpython.git
bpo-41215: Make assertion in the new parser more strict (GH-21364)
(cherry picked from commit 782f44b8fb
)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
This commit is contained in:
parent
6488a4a3c9
commit
edeaf61b68
|
@ -525,7 +525,7 @@ _PyPegen_dummy_name(Parser *p, ...)
|
||||||
static int
|
static int
|
||||||
_get_keyword_or_name_type(Parser *p, const char *name, int name_len)
|
_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 ||
|
if (name_len >= p->n_keyword_lists ||
|
||||||
p->keywords[name_len] == NULL ||
|
p->keywords[name_len] == NULL ||
|
||||||
p->keywords[name_len]->type == -1) {
|
p->keywords[name_len]->type == -1) {
|
||||||
|
|
Loading…
Reference in New Issue